Re:Replacing JavaScript Hot Path with WebAssembly
by z3t4 on Thursday February 14, 2019 @07:42PM
(#19167550)
I would try optimizing the JS before dropping down to webassembly. For example try replacing let and const with var as let and const in loops have to create a new variable for each iteration.
[ Parent
| on HN ]
Re:Replacing JavaScript Hot Path with WebAssembly
by Etheryte on Saturday February 16, 2019 @07:05AM
(#19178247)
That's not how let and const work at all, where did you get that impression?
Re:Replacing JavaScript Hot Path with WebAssembly
by z3t4 on Saturday February 16, 2019 @02:20PM
(#19180407)
Have you ever made a for loop using var only to have the variable point to the last value in the iteration ? And had to make a closure using forEach, function or self calling function ? With let you do not have to do that as a new variable is created for each iteration. Instead or reassigned when you use var.