Skip to content

Commit 34526c2

Browse files
authored
Remove logReadFiles from INCOMING_MODULE_JS_API by default (emscripten-core#26190)
1 parent eb68bad commit 34526c2

19 files changed

+67
-57
lines changed

ChangeLog.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ See docs/process.md for more on how version tagging works.
2020

2121
5.0.1 (in development)
2222
----------------------
23+
- `logReadFiles` was removed from the default `INCOMING_MODULE_JS_API` list.
24+
To use this feature you now need to explictly add `logReadFiles` to
25+
`INCOMING_MODULE_JS_API`. (#26190);
2326

2427
5.0.0 - 01/24/26
2528
----------------

site/source/docs/porting/files/packaging_files.rst

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,15 @@ Monitoring file usage
113113

114114
.. important:: Only package the files your app actually needs, in order to reduce download size and improve startup speed.
115115

116-
There is an option to log which files are actually used at runtime. To use it, define the :js:attr:`Module.logReadFiles` object. Each file that is read will be logged to stderr.
117-
118-
An alternative approach is to look at :js:func:`FS.readFiles` in your compiled JavaScript. This is an object with keys for all the files that were read from. You may find it easier to use than logging as it records files rather than potentially multiple file accesses.
116+
There is an option to log which files are actually used at runtime. To use it,
117+
define the :js:attr:`Module.logReadFiles` object. Each file that is read will be
118+
logged to stderr. To use this feautre you need to add ``logReadFiles`` to
119+
:ref:`INCOMING_MODULE_JS_API`.
120+
121+
An alternative approach is to look at :js:func:`FS.readFiles` in your compiled
122+
JavaScript. This is an object with keys for all the files that were read from.
123+
You may find it easier to use than logging as it records files rather than
124+
potentially multiple file accesses.
119125

120126
.. note:: You can also modify the :js:func:`FS.readFiles` object or remove it entirely. This can be useful, say, in order to see which files are read between two points in time in your app.
121127

src/settings.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -996,7 +996,7 @@ var INCOMING_MODULE_JS_API = [
996996
'buffer', 'canvas', 'doNotCaptureKeyboard', 'dynamicLibraries',
997997
'elementPointerLock', 'extraStackTrace', 'forcedAspectRatio',
998998
'instantiateWasm', 'keyboardListeningElement', 'freePreloadedMediaOnUse',
999-
'loadSplitModule', 'locateFile', 'logReadFiles', 'mainScriptUrlOrBlob', 'mem',
999+
'loadSplitModule', 'locateFile', 'mainScriptUrlOrBlob', 'mem',
10001000
'monitorRunDependencies', 'noExitRuntime', 'noInitialRun', 'onAbort',
10011001
'onExit', 'onFree', 'onFullScreen', 'onMalloc',
10021002
'onRealloc', 'onRuntimeInitialized', 'postMainLoop', 'postRun', 'preInit',

test/codesize/test_codesize_cxx_ctors1.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
2-
"a.out.js": 19623,
3-
"a.out.js.gz": 8144,
2+
"a.out.js": 19555,
3+
"a.out.js.gz": 8102,
44
"a.out.nodebug.wasm": 132844,
55
"a.out.nodebug.wasm.gz": 49884,
6-
"total": 152467,
7-
"total_gz": 58028,
6+
"total": 152399,
7+
"total_gz": 57986,
88
"sent": [
99
"__cxa_throw",
1010
"_abort_js",

test/codesize/test_codesize_cxx_ctors2.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
2-
"a.out.js": 19600,
3-
"a.out.js.gz": 8131,
2+
"a.out.js": 19532,
3+
"a.out.js.gz": 8087,
44
"a.out.nodebug.wasm": 132264,
55
"a.out.nodebug.wasm.gz": 49542,
6-
"total": 151864,
7-
"total_gz": 57673,
6+
"total": 151796,
7+
"total_gz": 57629,
88
"sent": [
99
"__cxa_throw",
1010
"_abort_js",

test/codesize/test_codesize_cxx_except.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
2-
"a.out.js": 23284,
3-
"a.out.js.gz": 9122,
2+
"a.out.js": 23216,
3+
"a.out.js.gz": 9081,
44
"a.out.nodebug.wasm": 172774,
55
"a.out.nodebug.wasm.gz": 57405,
6-
"total": 196058,
7-
"total_gz": 66527,
6+
"total": 195990,
7+
"total_gz": 66486,
88
"sent": [
99
"__cxa_begin_catch",
1010
"__cxa_end_catch",

test/codesize/test_codesize_cxx_except_wasm.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
2-
"a.out.js": 19434,
3-
"a.out.js.gz": 8068,
2+
"a.out.js": 19366,
3+
"a.out.js.gz": 8022,
44
"a.out.nodebug.wasm": 148169,
55
"a.out.nodebug.wasm.gz": 55285,
6-
"total": 167603,
7-
"total_gz": 63353,
6+
"total": 167535,
7+
"total_gz": 63307,
88
"sent": [
99
"_abort_js",
1010
"_tzset_js",

test/codesize/test_codesize_cxx_except_wasm_legacy.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
2-
"a.out.js": 19508,
3-
"a.out.js.gz": 8088,
2+
"a.out.js": 19440,
3+
"a.out.js.gz": 8042,
44
"a.out.nodebug.wasm": 145975,
55
"a.out.nodebug.wasm.gz": 54915,
6-
"total": 165483,
7-
"total_gz": 63003,
6+
"total": 165415,
7+
"total_gz": 62957,
88
"sent": [
99
"_abort_js",
1010
"_tzset_js",

test/codesize/test_codesize_cxx_lto.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
2-
"a.out.js": 18970,
3-
"a.out.js.gz": 7824,
2+
"a.out.js": 18902,
3+
"a.out.js.gz": 7782,
44
"a.out.nodebug.wasm": 102076,
55
"a.out.nodebug.wasm.gz": 39428,
6-
"total": 121046,
7-
"total_gz": 47252,
6+
"total": 120978,
7+
"total_gz": 47210,
88
"sent": [
99
"a (emscripten_resize_heap)",
1010
"b (_setitimer_js)",

test/codesize/test_codesize_cxx_mangle.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
2-
"a.out.js": 23334,
3-
"a.out.js.gz": 9141,
2+
"a.out.js": 23266,
3+
"a.out.js.gz": 9101,
44
"a.out.nodebug.wasm": 239224,
55
"a.out.nodebug.wasm.gz": 79795,
6-
"total": 262558,
7-
"total_gz": 88936,
6+
"total": 262490,
7+
"total_gz": 88896,
88
"sent": [
99
"__cxa_begin_catch",
1010
"__cxa_end_catch",

0 commit comments

Comments
 (0)