-
Notifications
You must be signed in to change notification settings - Fork 98
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
Can POW10_SPLIT_2 be smaller? #105
Comments
In each group denoted by |
We already have
We simultaneously need to remove We could additionally interleave I think that should work. |
POW10_SPLIT_2
is large, 8 * 4445 * 3 = 106,680 bytes:ryu/ryu/d2fixed_full_table.h
Line 1286 in 9976c57
Interestingly, it contains 1177 rows that are entirely zero. For example, lines 1583 and 1591 have nonzero elements, but lines 1584-1590 are entirely zero:
ryu/ryu/d2fixed_full_table.h
Lines 1583 to 1591 in 9976c57
These entirely zero rows are consuming 26.5% of the table, or 8 * 1177 * 3 = 28,248 bytes. Looking at the usage:
ryu/ryu/d2fixed.c
Lines 448 to 459 in 9976c57
ryu/ryu/d2fixed.c
Lines 650 to 653 in 9976c57
makes me think that reorganizing
POW10_OFFSET_2
andPOW10_SPLIT_2
might allow these entirely zero rows to be eliminated for free (i.e. no additional lookups/branches), possibly even improving performance if this results in skippingmulShift_mod1e9
calls, but this is currently at the outer limit of my understanding of the algorithm.The text was updated successfully, but these errors were encountered: