ekeuus / express-vs-rocket

Express vs Rocket Speed Experiment

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Express vs Rocket Speed Experiment

Express

To run the express server you need node.

The recommended node version for this repo is 12.x.x LTS, and I also recommend using nvm to manage different node versions with ease (for windows users, use nvm-windows).

After installing node, run:

cd express
npm install
npm run start

The second command installs all necessary npm packages, and the third command compiles typescript to javascript and runs the server.

Rocket

To run rocket you need rust, I highly recommend you use rustup for this, it's pretty much like nvm. If you are using windows, keep in mind that you need to install Visual Studio C++ Build Tools.

After installing rust via rustup, run:

cd rust-rocket
rustup override set nightly
cargo build --release

The second command will install rust nighlty, and only switch to it on this folder of your machine.

The third command installs dependencies and compiles the binary/executable which you can run with the following command from the rust-rocket folder:

Unix:

target/release/rust-rocket

Windows:

target/release/rust-rocket.exe

Future experimentation

After writing the article (you can read it here) tied to this repo, I came to the realization that it is unrealistic to switch entirely from an express server to rocket. So, my next experiment will be to bridge the gap between Node and Rocket with WASM.

At the time of writing this I have no idea how to work with WASM, but that's what this is about. Learning through experimentation.

Issues, problems or bugs

Please open an issue if you found a bug, typo, instructions are not clear, or your build is not working properly.

About

Express vs Rocket Speed Experiment


Languages

Language:Rust 60.4%Language:TypeScript 39.6%