[wasm] Improve exception handling measurements (#52846)
authorRadek Doulik <radek.doulik@gmail.com>
Tue, 25 May 2021 20:46:45 +0000 (22:46 +0200)
committerGitHub <noreply@github.com>
Tue, 25 May 2021 20:46:45 +0000 (22:46 +0200)
commitfe8ae98d813788605ab034449ec7d313e8baa1ef
tree5aae955f23297973c3c3d2e0e69f2e197bdb5a8b
parent24544e0cf7bd3c1085456b35de2048405afe4f18
[wasm] Improve exception handling measurements (#52846)

Add conditional throw to the leaf methods to avoid optimizing out the
exception handling code in `TryCatch` measurement.

Add new `NoExceptionHandling` measurement to measure case when no
exception handling is involved.

Example measurement, chrome/amd64:

| measurement | AOT | interp |
|-:|-:|-:|
|  Exceptions, NoExceptionHandling |     0.0164us |     0.0558us |
|             Exceptions, TryCatch |     0.1400us |     0.0592us |
|        Exceptions, TryCatchThrow |     0.0064ms |     0.0028ms |
|       Exceptions, TryCatchFilter |     0.4415us |     0.0645us |
| Exceptions, TryCatchFilterInline |     0.1263us |     0.0527us |
|   Json, non-ASCII text serialize |     1.4475ms |     8.6952ms |
| Json, non-ASCII text deserialize |     6.5332ms |    12.2220ms |
|            Json, small serialize |     0.2020ms |     0.2362ms |
|          Json, small deserialize |     0.2293ms |     0.3614ms |
|            Json, large serialize |    53.3021ms |    68.0000ms |
|          Json, large deserialize |    61.5176ms |   100.0377ms |
src/mono/sample/wasm/browser-bench/Exceptions.cs