-
Notifications
You must be signed in to change notification settings - Fork 38
More compact representation of compiled programs #249
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
src/compiler.ml
Outdated
| ENeg of D.constant * string | ||
| EPos of D.constant * D.term |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ENEg should be something like GlobalSymbol (* < 0 *)
EPos should be BoundVariable (* >= 0 *)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a bit surprise it is not 2 arrays, IIRC the bound variable one is small and the other is contiguous, so using the abs of the value as the array position seems more natural/understandable and would remove half of the data in the buckets
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean, D.constant is an int, -1 ... -maxg for globals, 0 .. maxl for locals, where maxl is typically not more than 3, while maxg can be large (thousands)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I went for the most straightforward changes, we can try to go even further. I don't think that splitting the array will matter much though.
the other is contiguous
Is it still the case after pruning? The set of live symbols could also contain globals IIUC.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(I did change the constructor names for clarity.)
The term is only used in this situation.
No need to keep a map as we never access this data by indexing but merely fold over it.
f075a36
to
f6e85a7
Compare
Follow-up of #248, basically made of two units.
This reduces the size of order.vo from 11087515 bytes to 10349640 bytes, i.e. another compounded 6%.
EDIT: the last commit compacts this file even more, to 10062305 bytes.