Skip to content

add -ug flag to abc2bc to use globals for the hp/asp/free_hp pointers, which reduces the stack-size

This adds an option to use globals for the hp and asp. This reduces stack usage, which can be important when generating wasm code, as JS engines have limited stack-size.

For computing acker 3 12 running WASM code with node, about 1300kb stack are required without using globals and 900kb with globals. For this example, no performance difference could be measured (the hp and asp are not used).

With globals the list example is about 4% slower with WASM. When running on x64, using globals makes the example 14% slower. This makes sense as with x64 the pointers are kept in registers if not using globals, so the costs of using globals are higher.

Edited by Steffen Michels

Merge request reports

Loading