8 ms·
If you know how to optimize, you can go far with JavaScript, especially with the React model. The problem is that many libraries have been infested with the imm
by johnnycerberus 5y ago
If you know how to optimize, you can go far with JavaScript, especially with the React model. The problem is that many libraries have been infested with the immutability virus (lodash, immutable.js, fp-ts) and it is used in places where it shouldn't be. Some time ago, I have modified a table library that was offering some filtering capabilities, managed to optimize it by boosting the performance 26x according to my benchmarks. When I created a PR, the authors of the library were literally disgusted by the C-like ordinary loops and mutations in order to achieve the same thing that they did by mixing lodash with streams, hundreds of deep copies, clones etc. even if it provided the same guarantees.
- pjmlp 5y agoEven the more heroic efforts can only go as far as JIT for a dynamic language is capable of, hence WebAssembly.
- johnnycerberus 5y agoIndeed, last time I've checked calling into wasm libs had a pretty high overhead. If your app is standalone or if your libary does long running processing in the library, then it is suitable. So far, I haven't seen wasm used in an interactive JS<multiple calls>WASM scenario.