Skip to content

Rewrote how buffifier web worker memory management fundamentally works.#1

Draft
addunn wants to merge 1 commit into
mainfrom
overhaul
Draft

Rewrote how buffifier web worker memory management fundamentally works.#1
addunn wants to merge 1 commit into
mainfrom
overhaul

Conversation

@addunn

@addunn addunn commented Jun 23, 2026

Copy link
Copy Markdown
Owner

Complete overhaul of project.

Improvements:

  • Now the only thing needed to make a JS object live in a shared memory buffer is to have the class inherit from BaseClass, and you define the props in a static block with this.buffify({...}). See objects.js.
  • Uses static {} blocks in classes to be able to set up the memory without having to explicitly call some buffifier method outside its class. Keeps code nicer.
  • When a block is unallocated/overwritten, there's now no need to set all references to that block to null. Because now each block will also have a "generational index" that gets incremented when the block contains a new object... And all pointers to the object are two values: block index and generational index.
  • Made memory blocks be two fixed sizes in the buffer for speed, reducing metadata, and simplicity. First block size grows from the beginning of the buffer, while the second block size grows from the end of the buffer.
  • Compacting/defragging not needed.

Improvements:
- The only thing needed to make an object live in a shared memory buffer is to have the class inherit from BaseClass, and you define the props in a static block with `this.buffify({...})`.
- Uses `static {}` blocks in classes to be able to set up the memory without having to explicitly call some buffifier method outside its class. Keeps code nicer.
- When a block is unallocated/overwritten, there's now no need to set all references to that block to null. Because now each block will also have a "generational index" that gets incremented when the block contains a new object... And all pointers to the object are two values: block index and generational index.
- Made memory blocks be two fixed sizes in the buffer for speed, reducing metadata, and simplicity. First block size grows from the beginning of the buffer, while the second block size grows from the end of the buffer.
- Compacting/defragging not needed.
@addunn addunn marked this pull request as draft June 23, 2026 19:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant