You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
➜ algorithm-template-ts git:(0fc33cb) ✗ porf -d --module ./benchmark.js
RangeError: Maximum call stack size exceeded
at generateForOf (file:///Users/seve/.nvm/versions/node/v22.3.0/lib/node_modules/porffor/compiler/codegen.js:4200:7)
at generate (file:///Users/seve/.nvm/versions/node/v22.3.0/lib/node_modules/porffor/compiler/codegen.js:265:29)
at generateCode (file:///Users/seve/.nvm/versions/node/v22.3.0/lib/node_modules/porffor/compiler/codegen.js:6380:22)
at generate (file:///Users/seve/.nvm/versions/node/v22.3.0/lib/node_modules/porffor/compiler/codegen.js:213:29)
at Object.generate (file:///Users/seve/.nvm/versions/node/v22.3.0/lib/node_modules/porffor/compiler/codegen.js:6206:14)
at funcRef (file:///Users/seve/.nvm/versions/node/v22.3.0/lib/node_modules/porffor/compiler/codegen.js:52:18)
at generateFunc (file:///Users/seve/.nvm/versions/node/v22.3.0/lib/node_modules/porffor/compiler/codegen.js:6371:66)
at generate (file:///Users/seve/.nvm/versions/node/v22.3.0/lib/node_modules/porffor/compiler/codegen.js:210:29)
at generateClass (file:///Users/seve/.nvm/versions/node/v22.3.0/lib/node_modules/porffor/compiler/codegen.js:5848:10)
at generateFunc (file:///Users/seve/.nvm/versions/node/v22.3.0/lib/node_modules/porffor/compiler/codegen.js:6058:17)
The text was updated successfully, but these errors were encountered:
The current implementation of for-of in porffor duplicates code. Nested for-of loops (which appear in the benchmark) make this much worse and causes more instructions to generate than it can handle. The crash here in particular is because porffor uses array.push(...values); to push values into an array, which breaks with too many parameters.
File: https://github.com/tscircuit/autorouting/blob/main/algos/algorithm-template-ts/benchmark.ts
Compiled with
bun build ./benchmark.ts
Run with
porf --module ./benchmark.js
The text was updated successfully, but these errors were encountered: