-
Notifications
You must be signed in to change notification settings - Fork 207
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
transposed weakmaps - performance cliffs in XS revealed by #3105 #3118
Comments
(corrected above "seconds" --> "milliseconds") |
I've updated the I've added my results in https://github.com/Agoric/agoric-sdk/tree/test-harden-perf/packages/xsnap/harden-perf-node and https://github.com/Agoric/agoric-sdk/tree/test-harden-perf/packages/xsnap/harden-perf-xsnap . This is using the Moddable submodule at commit ddab2e5cb0b221973d83705d0c2a60e4c6b41bb2 (probably from our listHard testThe "listHard" test grows an N-deep linked list, hardening at each step ( Under Node.js, the
However, under XS, the N=100 case shows BOTH taking 100x less time than either POSITIVE or NEGATIVE. (the N=1000 POSITIVE/NEGATIVE tests timed out after at least 30s of runtime, and the BOTH tests exceeded the compute meter limit until I disabled it):
This is really strange, and we don't have any idea what's happening. The fact that it doesn't happen under Node.js suggests that there's some property of the XS implementation that interacts weirdly with the BOTH mode.. something is getting short-circuited. hardList testThe
|
Moddable code landing would obviate this ticket |
this just in:
|
Update the packages/xsnap/moddable submodule to current public branch, plus an upcoming xsPromise.c fix. * current public branch includes a new WeakMap design, which drastically improves GC speed * the xsPromise.c fix now correctly drops rejection handlers for resolved promises, which was probably the cause of #3406 (unexpected retention of Presences used in `E()` calls, resulting in too few GC actions) refs #3406 (might even close it) refs #3118
#3415 should fix this. We have some evidence that it does. Until we find out otherwise, let's call this done. |
Prior to the Moddable algorithm, the best known was Felix's algorithm from the thread at Now for historic interest only, so that it will be captured somewhere findable, here is, first, the paper Felix is responding to My transpose of Felix's algorithm and my sketch illustrating the transposed Felix algorithm when the transposed table is represented as a linked list of pairs (idea from Moddable). |
endojs/endo#706 is an attempt to implement endojs/endo#705 , in order to get a speedup of
harden
on XS.#3105 measures it to see if it actually works. To reproduce, you need to checkout
https://github.com/Agoric/agoric-sdk/tree/test-harden-perf and https://github.com/endojs/endo/tree/alt-harden and
yarn link
them together. Then inagoric-sdk at
packages/xsnap
runtime yarn test -sv test/test-harden-perf.js
The output I got is in the attached file:
harden-perf-data2.txt
See if you get similar output. This output contains some results so bizarre that it makes me wonder if there is something terribly wrong about the code being tested or the code testing it. If not, then these bizarre cases demonstrate some bizarre performance cliffs in XS that we all need to understand. Attn @phoddie . A striking example is the contrast between the following two results:
vs
Both of these are running the
listHard
test 100 deep. The listHard test is:The first record is running it where
harden
is implemented using both the positive and negative branding techniques, and testing them for consistency with each other. They apparently are consistent with each other, at least for this case, or we would have gotten an error.The second does
harden
using only the positive technique. The first should be doing all the work of the second and much more. However the first has acompute
meter of 100,211 and completes in under one milisecond. The second has acompute
meter of 5,905,005 and completes in over 72 miliseconds.The text was updated successfully, but these errors were encountered: