-
Notifications
You must be signed in to change notification settings - Fork 116
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
Slow opcode analysis #750
Comments
I was a little distrustful of the granularity and accuracy of CLOCK_MONOTONIC so I reran the benchmarks with RDTSC and qjs pinned to a single core and a few things changed a lot. Here is that typeof table and keep in mind sqlite> select *,t/c as r from x where s like '%typeof%';
┌─────────┬──────────┬─────────────────────┬────┐
│ c │ t │ s │ r │
├─────────┼──────────┼─────────────────────┼────┤
│ 3363637 │ 81868001 │ typeof │ 24 │
│ 832065 │ 21032232 │ typeof_is_undefined │ 25 │
│ 321758 │ 8738744 │ typeof_is_function │ 27 │
└─────────┴──────────┴─────────────────────┴────┘ get_field is still slow:
Top 30 with min. 1,000 calls cutoff.
I'd say this gives some good leads where to start optimizing, like how |
This is awesome! |
Wow! Fantastic job! Maybe you can gate this behind a flag, capture the output of this in CI and compare with the change so we notice performance regressions/improvments? |
Yep, I plan to make it less ad hoc eventually. |
I added per-opcode instrumentation, ran web-tooling-benchmark, and loaded the results in sqlite. Results are interesting.
c = call count
t = total time (in ns)
s = opcode name
r = t / c, avg. opcode execution time (in ns)
The first entries are
call
instructions but that's because I can't split between self time and cumulative time; time spent in the function call is attributed to thecall
opcode.Observations:
for_of_next and for_in_start are surprisingly slow; maybe because of property lookups?
fclosure is reeeally slow (4.6 microseconds!); fclosure8 is better bit still sluggish. Could be a benchmarking artifact; the suite is basically a bunch of really big functions
The text was updated successfully, but these errors were encountered: