Open marcoonroad opened 7 years ago
I have created the finalizers
branch (from master
base) to gather the GC finalizer algorithm for a matter of historical optimization. The branch master
will be merged with the lua-51
branch.
Benchmarks should be run on:
I will use the following implementations on benchmark:
finalizers
branch)lua-51
branch)I should take the following intervals/levels of cloning hierarchies (the forkbomb test on spec/
directory is a hint of such thing):
Also, I must populate the structures with the following number of entries:
Later, if my machine supports the charge, I will test both entries & levels intervals together. Tests must be ran at least 10 times, and the average time will be taken from such reports.
Benchmarks were deferred to the next release/version. But such issue will remain open yet.
BUMP:
I should move documentation from the wiki pages. They are terrible to navigate and edit. A better approach would be online documentation on the landing page of this project. With Jekyll, that thing is not hard (in fact, this project already uses Jekyll on README.md documentation -- the branch for GH pages deploy is gh-pages
).
In the experimental
lua-51
branch I using a split & scan algorithm where the cloning procedure splits the current original prototype in two, the former part will be the new structure for the prototype and the latter, the structure/dictionary for clone object. With that approach, I have achieved support for Lua v5.1 while maintaining the Clone early, Clone often lemma. This kind of implementation is in some sense asynchronous, cause the evaluation order of super-structure scanning is unknown until runtime. The whole super/original structure/dictionary can be iterated entirely, or just a few (mostly duepairs
function semantics). That implementation relies on coroutines rather thanmaster
branch's finalizers. The respective scanners hold strong references for such parent structure, but not the objects (the clone & prototype, they won't ever notice that super structure). The scanner copies lazily the fields from that parent structure, when the scan process finishes, it collects itself, thus, decreasing the pointer/counter for that super structure (which will be prone to GC).