4 ms·
You may be happy to learn that in modern Node, the 3200x2400 example which used to take 6.8 seconds now runs in 0.25 seconds. I unfortunately don't have a cloju
by meetups323 5y ago
You may be happy to learn that in modern Node, the 3200x2400 example which used to take 6.8 seconds now runs in 0.25 seconds. I unfortunately don't have a clojure setupt to compare against.
- kragen 5y agoThat's astounding! Maybe V8 is catching up to LuaJIT's performance?
- capableweb 5y agoFor me (on AMD Ryzen 9 5950X, Arch Linux, Clojure 1.10.3 [OpenJDK 17.0.1] and NodeJS 17.4.0), circle.js takes ~0.15 seconds and the circle.clj takes ~0.19 seconds. After running circle.clj 100 times in a running JVM though, it takes the time down to ~0.092 seconds for each run.
- meetups323 5y agoWell of course I now have to ask how long it takes in node after running the script a hundred times
- capableweb 5y agoDoes NodeJS do any on-the-fly optimization like the JVM does?
- meetups323 5y agoYes, if you dig around V8 performance profiles you'll see some massive "Optimizing Code" blocks that appear at the bottom of a frequently-hit routine once, then subsequent calls to that same routine will run faster. That being said, while I haven't investigated this super thoroughly, in my experience the delta is usually small.
- meetups323 5y agoTrying again with timers internal to the code (previously used `time node ray.js`), initial go is 190ms, then 170ms, 160ms, and after that hovers around 140-150ms for the remaining 97 runs. If I remove the FS operations it's instead 160ms initially, then drops to 130ms by the third go and hovers around there.
- kragen 5y agoThanks! Does this include the time to actually write the image data to the filesystem, or just append it to an internal buffer that will be eventually written?
- kragen 5y agoYes, V8 doing JIT optimization is why the modern web exists. Before V8 JS was slow so you only used it when you had to.