Skip to content
NewDo it at build time

I writenotes on SLua memory.

01Writing

Latest posts

All posts
TypeScript
TypeScript13 min

Do it at build time

A metatable keeps field names in the running script. TypeScript can check them at build time and emit plain positions instead. For 100 buffer records, that's of the script's memory rather than , with reads about 12 times as fast.

Objects9 min

What does named access cost?

A shared metatable lets code read arrays and buffers by field name. In the test, 100 records use about of the script's memory with named fields, or as buffers with names.

Capacity10 min

Size lists before they round up

An appended 285-entry list in SLua uses 384 slots at 16 bytes each. I test when table.create saves memory and how to size my HUD's paint lists.

Data9 min

Pack records before they fill linkset data

For this 14-field test record, linkset data holds about 660 JSON objects or 6,000 packed buffers. Compare storage savings with script memory and code costs.

02Building

Projects

All projects

Team member

Alchemy Viewer

An open-source viewer for Second Life, focused on stability, performance, and new technology. I'm part of the team.

  • viewer
  • c++

@gwigz/slua

SLua types and a TypeScriptToLua plugin. Every LSL and SLua function is typed, so a bad call fails the build instead of the script.

  • typescript
  • tstl
  • slua

boq

A Second Life store for creative tools, clothing, and accessories. The first gadgets are on the Marketplace, including a head scritcher, a laser pointer, and gesture effects.

  • store
  • gadgets
  • vfx