Pkg is a Node.js application compiler. It makes application distribution easier without requiring a complex infrastructure setup like Docker. It packages and creates a single executable that can also contain non-executable asset files.
I made some benchmarks using Node 8 (will become LTS soon). The benchmark is a minimal Express.js application that outputs a page generated from random data using an EJS template. With this application the results were:
- Under the Crankshaft compilation pipeline there is a performance penalty about 31%.
- For Ignition+TurboFan pipeline the performance penalty is much smaller at about 1.4%
- Without packaging, the Ignition+TurboFan pipeline is 6.7% slower than the Crankshaft.
The benchmark code is on GitHub.
The Crankshaft compilation pileline performance penalty can be avoided when the application source is included. There are certain conditions required for this. See discussion here for more information.