-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Disable trace logs by default to optimize module compilation #6548
Comments
In bytecodealliance#5382 ("egraph support: rewrite to work in terms of CLIF data structures"), we added the `trace-log` feature to the set of default features for `cranelift-codegen`. I think this was an accident, probably added while debugging and overlooked when cleaning up to merge. So let's undo that change. Fixes bytecodealliance#6548.
I think this was just an accident, so I've opened #6549 as the minimal fix. It would be nice to also add trace-log features to other crates which enable the feature in cranelift-codegen, but I don't think it's immediately necessary. |
Thanks that minimal fix improves compilation speed for our big model on my machine from 7.0 s -> 5.55s 🎉 which is very significant and about what we saw last time when we implemented the feature flag for excluding the heavy trace log statements. |
…e#6549) In bytecodealliance#5382 ("egraph support: rewrite to work in terms of CLIF data structures"), we added the `trace-log` feature to the set of default features for `cranelift-codegen`. I think this was an accident, probably added while debugging and overlooked when cleaning up to merge. So let's undo that change. Fixes bytecodealliance#6548.
…e#6549) In bytecodealliance#5382 ("egraph support: rewrite to work in terms of CLIF data structures"), we added the `trace-log` feature to the set of default features for `cranelift-codegen`. I think this was an accident, probably added while debugging and overlooked when cleaning up to merge. So let's undo that change. Fixes bytecodealliance#6548.
In #5382 ("egraph support: rewrite to work in terms of CLIF data structures"), we added the `trace-log` feature to the set of default features for `cranelift-codegen`. I think this was an accident, probably added while debugging and overlooked when cleaning up to merge. So let's undo that change. Fixes #6548.
…e#6549) In bytecodealliance#5382 ("egraph support: rewrite to work in terms of CLIF data structures"), we added the `trace-log` feature to the set of default features for `cranelift-codegen`. I think this was an accident, probably added while debugging and overlooked when cleaning up to merge. So let's undo that change. Fixes bytecodealliance#6548.
In #5382 ("egraph support: rewrite to work in terms of CLIF data structures"), we added the `trace-log` feature to the set of default features for `cranelift-codegen`. I think this was an accident, probably added while debugging and overlooked when cleaning up to merge. So let's undo that change. Fixes #6548.
There has been a performance regression for module compilation. The PR #5382 added the
trace-log
feature by default (this line)Historically high-frequent trace logs have been a performance bottleneck. Some efforts were made to revert that (#4481, #4484, #2758). In #4484 @bnjbvr added this feature flag, claiming perf increment of 32%, whereafter this flag was enabled by default in #5382.
The following numbers are from sampling the app once before and after with the macos instruments profiler.
The module compilation code takes in total 29.5 sec, of that three log functions here take up ~13 secs in total (43% of total).
Disabling trace logs results in total 10.3s, which is roughly ~65% faster.
Branch for this instrumentation can be found here: https://github.com/bytecodealliance/wasmtime/compare/main...TimonPost:wasmtime:timon/make-trace-logs-not-default?expand=1
Feature
We probably want to disable 'trace-log' by default as shown this takes ~60% of the total module compilation. Also we likely want to expose upstream control over this feature.
Benefit
Speeds up compilation by 60% :).
Implementation
trace-log
feature from the default features array incodegen
.trace-log
feature to various crates that depend oncodegen
, and from those crates expose the ability to 'enable' trace logs as opt in.wasmtime
crate so that we can decide on enabling/disabling logs.Details
The text was updated successfully, but these errors were encountered: