Stream: git-wasmtime

Topic: wasmtime / Issue #2213 Performance decrease when function...


view this post on Zulip Wasmtime GitHub notifications bot (Sep 21 2020 at 11:42):

Rochet2 labeled Issue #2213:

__attribute__((used))
int hello(int i) {
    return i;
}

Then measure the time it takes to call instance.get_func(&function_name) for each instance's hello function.
Then create 1000 modules with the same code, except the hello functions in each module has an increasing integer in its name.
The time measurements should differ.

In our tests the time with all modules having hello function name takes
0.00096920039999999778 seconds
and when the function names are different (have different number at the end of them) the measured time is
0.000034551999999999665 seconds

The difference is quite significant and the only change we tested was to change the function names in the modules.

view this post on Zulip Wasmtime GitHub notifications bot (Sep 21 2020 at 11:42):

Rochet2 opened Issue #2213:

__attribute__((used))
int hello(int i) {
    return i;
}

Then measure the time it takes to call instance.get_func(&function_name) for each instance's hello function.
Then create 1000 modules with the same code, except the hello functions in each module has an increasing integer in its name.
The time measurements should differ.

In our tests the time with all modules having hello function name takes
0.00096920039999999778 seconds
and when the function names are different (have different number at the end of them) the measured time is
0.000034551999999999665 seconds

The difference is quite significant and the only change we tested was to change the function names in the modules.

view this post on Zulip Wasmtime GitHub notifications bot (Sep 21 2020 at 11:45):

Rochet2 edited Issue #2213:

__attribute__((used))
int hello(int i) {
    return i;
}

Then measure the time it takes to call instance.get_func(&function_name) for each instance's hello function.
Then create 1000 modules with the same code, except the hello functions in each module has an increasing integer in its name.
The time measurements should differ.

In our tests when all modules are having the same hello function name, the average time for a single fetch is
0.00096920039999999778 seconds
and when the function names are different (have different number at the end of them) the measured time is
0.000034551999999999665 seconds

The difference is quite significant and the only change we tested was to change the function names in the modules.

view this post on Zulip Wasmtime GitHub notifications bot (Sep 21 2020 at 11:50):

Rochet2 edited Issue #2213:

__attribute__((used))
int hello(int i) {
    return i;
}

Then measure the time it takes to call instance.get_func(&function_name) for each instance's hello function.
Then create 1000 modules with the same code, except the hello functions in each module has an increasing integer in its name.
The time measurements should differ.

In our tests when all modules are having the same hello function name, the average time for a single fetch is
0.0010949896000000006 seconds
and when the function names are different (have different number at the end of them) the measured time is
0.000036767999999999476 seconds

The difference is quite significant and the only change we tested was to change the function names in the modules.

view this post on Zulip Wasmtime GitHub notifications bot (Sep 22 2020 at 17:10):

alexcrichton commented on Issue #2213:

Thanks for the report, and this does indeed seem a little bizarre! Would you be able to share some code of how you're using the wasmtime crate, and ideally what wasm blobs you're using?

view this post on Zulip Wasmtime GitHub notifications bot (Nov 22 2020 at 23:19):

Rochet2 commented on Issue #2213:

Thanks for your response. Closing the issue as new tests show that the measurement was likely simply flawed.
The original measuring code is not available, but attempts to replicate the issue based on code used at the time the issue was created or based on the issue description yields the expected correct result.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 22 2020 at 23:19):

Rochet2 closed Issue #2213:

__attribute__((used))
int hello(int i) {
    return i;
}

Then measure the time it takes to call instance.get_func(&function_name) for each instance's hello function.
Then create 1000 modules with the same code, except the hello functions in each module has an increasing integer in its name.
The time measurements should differ.

In our tests when all modules are having the same hello function name, the average time for a single fetch is
0.0010949896000000006 seconds
and when the function names are different (have different number at the end of them) the measured time is
0.000036767999999999476 seconds

The difference is quite significant and the only change we tested was to change the function names in the modules.


Last updated: Nov 22 2024 at 16:03 UTC