Commit e11edd8
authored
Optimize JS compiler caching for standard builds (#27026)
Linker system stubs, such as libpthread_stub.js, are dynamically
appended to settings.JS_LIBRARIES for all standard C/C++ builds.
Previously, the JS output cache check did not distinguish between these
system stubs and user-defined JS libraries (passed via --js-library). As
a result, standard builds always bypassed the compilation cache,
triggering a Node.js compilation run on every invocation.
Restrict the cache bypass condition to check only for user libraries
(libraries located outside the Emscripten source tree). Standard
compilations now successfully hit the JS output cache, decreasing
baseline compilation wall clock time of a hello world C program by 52%
(from 472 ms down to 282 ms).
Add an integration test to validate JavaScript compilation caching
(covering hits, misses, user library bypasses, and option-based cache
entries).1 parent 7229f15 commit e11edd8
2 files changed
Lines changed: 44 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
870 | 870 | | |
871 | 871 | | |
872 | 872 | | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
| 884 | + | |
| 885 | + | |
| 886 | + | |
| 887 | + | |
| 888 | + | |
| 889 | + | |
| 890 | + | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
| 896 | + | |
| 897 | + | |
| 898 | + | |
| 899 | + | |
| 900 | + | |
| 901 | + | |
| 902 | + | |
| 903 | + | |
| 904 | + | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
| 910 | + | |
| 911 | + | |
| 912 | + | |
| 913 | + | |
| 914 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
346 | 346 | | |
347 | 347 | | |
348 | 348 | | |
349 | | - | |
| 349 | + | |
| 350 | + | |
350 | 351 | | |
351 | 352 | | |
352 | 353 | | |
| |||
0 commit comments