4 ms·
Not exactly the same thing but JITs can turn dynamic objects into structs if the structure is consistent. JS runtimes and Julia do this as far as I know.
by dgb23 4y ago
Not exactly the same thing but JITs can turn dynamic objects into structs if the structure is consistent. JS runtimes and Julia do this as far as I know.
- estebank 4y agoYes! Java as well. And this is how those languages can show impressive benchmarks for consistent workloads. In theory they can even surpass AoT languages. In practice it depends on the specifics.
- mmis1000 4y agoFirefox's js runtime also do tricks like generate multi copy of optimized function when the function has multi call site instead make one with lots of if else. So it no longer suffer from the problem that function that frequently get multi different type of parameters from different call site has poor performance. It's probably exactly how templates work, except the details are invisible to users. https://hacks.mozilla.org/2020/11/warp-improved-js-performance-in-firefox-83/ https://hacks.mozilla.org/2020/11/warp-improved-js-performan...
- adgjlsfhk1 4y agoJulia doesn't do this. It just has structs in the first place.