📜 ⬆️ ⬇️

Dissatisfied with javascript speed? - Wait a year and a half, and it will pass!

I remind you (because it was probably forgotten) that on May 22, 2012, I experimented with reading Fidonet echomail headers (stored in JAM format) using my own module written for Node.js (based on the jParser engine turned up, the documentation on which translated a little ).

Then, driving test readings on a single-core Pentium IV (2.2 GHz), I was unhappy with the speed: it took three to four seconds to read 8222 headers from the archive of just one echo conference conducted since March 2007.

This week, I again got my hands on the source code of that module; and I started by transferring the previous test to the Mocha engine and transferring the testing to the Travis CI server, specifying such settings in the .travis.yml file that would provide testing on three consecutive versions of the Node.js engine - by 0.6, by 0.8 and at 0.10.
')
It turned out that the difference in speed is visible to the naked eye:


When you look at these results, you are first tempted to see an arithmetic progression (three seconds → two seconds → one second), with the promising conclusion that in the next version of the Node engine, the test will start to work instantly.

In fact, of course, the result only shows that in the Node 0.8 version the test works about one and a half times faster than in the previous version (0.6), and in the Node 0.10 version it is even twice as fast as in the previous version ( 0.8).

But that's not bad either.

In addition, this spring I purchased a newer computer based on the i7-3770 quad-core processor , and on it the same test takes even less time - it is closer to half a second than to a whole second:

[screenshot]

This is understandable: Travis is actually using virtual machines, but I really.

The totality of the above observations allows us to confidently and joyfully assert that Node.js accelerates dramatically from version to version (probably also due to the increased speed of the V8 engine, on which Node is based), and in combination with the increase in computer performance, this allows you to the wait and see tactics I put in my headline.

You can spend your time optimizing the work of your javascripts, but only if you no longer have anything to seriously improve them, and only if you are sure that you will show a comparable result (acceleration 1.5-2 times in six months or a year), and not for the final users small script acceleration will still remain hardly noticeable against the background of a sharp acceleration of the engine for the same time.

Source: https://habr.com/ru/post/193482/


All Articles