Topic: 100% Speed Boost for Express Generator
Hi,
so I spent the evening testing Express Generator on different JavaScript Runtimes. The default one that Popov uses is NodeJS from https://nodejs.org/en/download/. However, there are several more runtimes like Deno, Bun, and GraalVM Enterprise JS. Unfortunately, I couldn´t get Express Generator to run on either Deno or Bun, because they are not fully compatible with the node.js modules and NPM that Mr. Popov uses.
However, GraalVM Enterprise JS is praised to be 100% compatible with Node JS and since I´ve been using the Java runtime part of it with all the advanced compiler optimizations for many years already - always gaining about 15% in each and every Java application, I thought it´s time to also look into their Javascript Node JS compatible engine, which also uses all the optimizations, and see what it does for Express Generator.
The result is an almost 100% speed boost for Express Generator if running the exact same settings side-by-side between Node JS and the GraalVM Node JS implementation. Have a look at this video:
Here is how you can get this too:
1) Go to https://www.graalvm.org/downloads/
2) Grab the latest GraalVM Enterprise Edition (faster than the community edition, so make sure you use this one) and make sure to select the Java 17 version (their Java 19 is bugged and has an issue at the moment).
Note: in order to download the Enterprise Edition, you need to create a *free* account with Oracle. It will prompt you for your login credentials when you are trying to download, so just create a new account there, then try the download again.
3) Uncompress the ZIP file to a directory of your choice, go to the /bin subfolder, open a command prompt and run
gu install nodejs
4) Afterward you will have a new node.cmd in the /bin directory, which you can use to run Express Generator the usual way. Just make sure that your original Node JS runtime is not on your system-wide %PATH% variable because otherwise, Windows will always first execute the node.exe and ignore the node.cmd. It´s best if you simply specify the full path to the node.cmd. So, for example:
C:\PortablePrograms\Java\bin\node.cmd .\bin\gen.js --settings .\my-settings.ini
5) Enjoy the 100% speed boost :-)