Skip to content

Reduce initial memory usage per thread #8

@poef

Description

@poef

Right now each thread gets a copy of meta.index.id, which can get quite large. This cannot be avoided, unless we make a single indexing thread, and use that for access to index information. This seem tricky and a potential bottleneck. The only other option is to try to find a more memory-friendly way to store the index.

In addition when parsing the sharedArrayBuffer, for each object a Proxy is created, which will parse the object when accessed.
It should be possible to avoid making those Proxies, untill they are accessed in most cases. E.g. when an object is in an array, the array can be turned into a proxy that only creates a Proxy for each object accessed, when it is accessed itself. Each object has itself a Proxy, which can do the same for direct links to other objects.
The main problem is that the root object contains links to most if not all other objects, so here is where the array proxy comes in. The meta.resultArray is another place where we need a proxy for the array. This proxy must have access to the position information for each specific object. So some information still gets copied around.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions