-
Notifications
You must be signed in to change notification settings - Fork 191
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
Explore performance 3 #1598
Explore performance 3 #1598
Conversation
duration phase estimated improvement -775ms [-863ms to -681ms] OR -5.23% [-5.83% to -4.6%] [16:19:59] Generating Benchmark Reports [started]
JSON: /home/runner/work/glimmer-vm/glimmer-vm/tracerbench-results/compare.json PDF: /home/runner/work/glimmer-vm/glimmer-vm/tracerbench-results/artifact-1.pdf HTML: /home/runner/work/glimmer-vm/glimmer-vm/tracerbench-results/artifact-1.html |
It seems like these were intended to be stripped/strippable in prod/turned into no-op, any idea why that isn’t happening? (or maybe the stripping was just never implemented?) |
I think the idea was that it would be dependent on the user's terser config -- and that is not reliable. There is a prod build in the glimmer packages, but it seems ember projects don't currently use it (this is something we could try to fix, but I think it'd be better to try to solve with a merged monorepo (glimmer-vm in to ember-source)), so we had less layers of build configs. At the same time, this change alone is not enough to regain lost perf, so there is more exploration to be had. |
I'm not sure that is a real issue for a few reasons. For one thing, Ember itself relies on the same kinds of transformations for its own assertions, etc, and if all of that is generally not working correctly, then we have bigger problems to worry about. Also, if the transformation is active and working properly, it should ultimately result in something along the lines of:
That is the part that we would hope terser to remove – delete the branch altogether, then realize the import is unused and remove it (or maybe our transformations have already inlined the debug code and removed the import). Even if that is not working properly due to terser config, the worst that could happen is bloating the bundle size a bit, which is not ideal but shouldn't have the kind of effect we are seeing. At runtime, the engines won't ever run the actual expensive checking code, evaluate its arguments, etc. So if that's all there is to it, I would expect the worse that could happen is a slightly inflated boot time but gets amortized away in the repeated runtime benchmarks. So I would think that to whatever extent that debug code gets into the final Ember build at all, and, worse running at runtime, is indicative of a build configuration issue on our (or Ember's end), and #1599 seems to support that. That appears to account for most of the regression and lines up with the timeline (build refactors here, build refactors on Ember side, etc) |
it's perhaps not just terser, or we need more inlining or something. Or maybe it's possible that the way the checks are written -- they just aren't strippable. They don't have any production swaps like assert does so I don't know how terser would remove them |
Yea it seems pretty clear to me the intent is to replace those Either there is a misconfiguration and that rewrite stopped happening, or @wycats wrote those checks intending to later write the transform but never did. If it’s the latter, assuming we are already doing these sort of rewrites for some other cases, it shouldn’t be too bad to add this case too. The checks are doing a useful thing (both for typescript during development, and to catch otherwise difficult to catch bugs in dev mode/when running tests), just have to be dropped somehow in production |
Closing, because #1606 solved a lot |
Related:
The goal of this PR is to try to see if we can undo the perf losses reported by