errdefer
in json.parseInternal
causes lots of code generation
#5327
Labels
enhancement
Solving this issue will likely involve adding new logic or components to the codebase.
stage1
The process of building from source via WebAssembly and the C backend.
Milestone
Specifically, this
errdefer
here:zig/lib/std/json.zig
Lines 1443 to 1449 in f2d3266
Later, there is an inline loop for checking if the JSON key matches any of the fields. Inside that inline loop it calls
try parse(...)
.When I add some
@compileLog
statements inside theerrdefer
's inline loop and try to parse thisglTF
struct, it logs over 5000 calls to the@compileLog
statement.Fixes
errdefer
and manually catch the errorjson.parse
functionerrdefer
smart enough to avoid generating this codeO(n^2)
timesThe text was updated successfully, but these errors were encountered: