-
Notifications
You must be signed in to change notification settings - Fork 23
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
Introduce LiteralI32Expression #32
Comments
Just to contrast with “never”: https://github.com/es-shims/es5-shim/blob/master/es5-shim.js#L1141, for example. Certainly it’s not common. |
Well, I can now replace the above never with once, but that doesn't change the trend :) |
I would suspect that the trend is actually much, much smaller numbers than 32 bit. |
Yes, the most common numbers I encounter are actually 0 and 1. So I believe that we should actually specialize even further for these numbers. But variable-length encoding gives us in a single byte (+generally 1 byte header) all numbers between -63 and +64, which should cover most cases, in two bytes (+ header) -8191 to +8192, which should cover most of the rest. |
For context, I have modified the binary format to transparently bias towards Another optimization being examined will automatically create a new pseudo-interface for common occurrences, including |
In practice, pretty much all integer literal numbers we encounter are within [|-2^31, 2^31[| (I believe that I have never seen an integer literal outside of this range). Experience shows that introducing the following is a pretty good filesize win:
Any objection to this? The assumption being that the
long
will be a variable length encoded integer.The text was updated successfully, but these errors were encountered: