Stream: git-wasmtime

Topic: wasmtime / issue #6548 Disable trace logs by default to o...


view this post on Zulip Wasmtime GitHub notifications bot (Jun 09 2023 at 16:35):

TimonPost opened issue #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).

![image](https://github.com/bytecodealliance/wasmtime/assets/19969910/55794c87-7315-4f33-9b07-2bb05aa5e015)

Disabling trace logs results in total 10.3s, which is roughly ~65% faster.

<img width="1332" alt="image" src="https://github.com/bytecodealliance/wasmtime/assets/19969910/4636be43-e9c7-4013-84a8-242f9f17ab22">

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

Details

view this post on Zulip Wasmtime GitHub notifications bot (Jun 09 2023 at 16:39):

TimonPost edited issue #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).

![image](https://github.com/bytecodealliance/wasmtime/assets/19969910/55794c87-7315-4f33-9b07-2bb05aa5e015)

Disabling trace logs results in total 10.3s, which is roughly ~65% faster.

<img width="1332" alt="image" src="https://github.com/bytecodealliance/wasmtime/assets/19969910/4636be43-e9c7-4013-84a8-242f9f17ab22">

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

Details

view this post on Zulip Wasmtime GitHub notifications bot (Jun 09 2023 at 17:00):

jameysharp commented on issue #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.

view this post on Zulip Wasmtime GitHub notifications bot (Jun 09 2023 at 17:30):

repi commented on issue #6548:

Thanks that minimal fix improves compilation speed for our big model on my machine from 7.0 s -> 5.55s :tada: which is very significant and about what we saw last time when we implemented the feature flag for excluding the heavy trace log statements.

view this post on Zulip Wasmtime GitHub notifications bot (Jun 09 2023 at 18:28):

jameysharp closed issue #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).

![image](https://github.com/bytecodealliance/wasmtime/assets/19969910/55794c87-7315-4f33-9b07-2bb05aa5e015)

Disabling trace logs results in total 10.3s, which is roughly ~65% faster.

<img width="1332" alt="image" src="https://github.com/bytecodealliance/wasmtime/assets/19969910/4636be43-e9c7-4013-84a8-242f9f17ab22">

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

Details


Last updated: Nov 22 2024 at 17:03 UTC