Comments (7)
I benchmarked this for an Express-based web app with Node 8.0.0 and found that the compiled version was 31% slower than the plain version under Crankshaft. With Ignition+TurboFan the difference was only 1.4%. More info: https://github.com/rla/pkg-express-benchmark
from pkg.
@rla. Pkg defaults to stripping the source code of root package (index.js
in your case). If you add -d
option to pkg command line you see The file was included as bytecode (no sources)
. That slowdown is known and reasonable tradeoff for stripping source code, because Crankshaft can not optimize without source code. Btw i am really surprised that it is as low as 31%.
I am sure the results will get much better if you make pkg put the source of index.js
into executable. In order to do it, you can remove "private": true
and add "license": "MIT"
to package.json
(it is one of ways to override that default so far).
from pkg.
As far as I understand result bin contains node altogether with cached code data produced by https://nodejs.org/api/vm.html#vm_class_vm_script. Am I right? It would be nice to have a little info related to implementation details.
from pkg.
Good job, @rla! I will try to address that slowdown.
from pkg.
@igorklopov, I have updated the benchmark. With source included the difference for Crankshaft decreases to 1.1%. I would be nice if this gets documented in README otherwise users would be throwing away over 30% of performance if they hit similar conditions (no license
property or have private: true
property value).
from pkg.
Right! Thanks! π
from pkg.
Closing this as stale π Thank you anyway!
from pkg.
Related Issues (20)
- ffi-napi Error: Dynamic Linking Error: Win32 error 126
- Trojan.disco detected by VirusTotal HOT 12
- pkg with worker_threads HOT 12
- "[Error 2] No such file or directory" for the file that is exist in the module directory HOT 1
- pkg 5.8.1 somehow lists pkg-fetch 3.4.2 as required dependency in package-lock.json. How to update it so 3.5 is leveraged? HOT 4
- MacOS GitHub actions βΒ Error: spawn Unknown system error -86 HOT 4
- Module-Alias not working with pkg HOT 1
- Cannot build base binary for FreeBSD
- Latest arm64 macOS binary does not work when built on Ubuntu HOT 2
- there is something evil bug when we start a exe which is created by pkg
- Failed to compile Gluon applications correctly
- Issue #1962 should not be closed
- Not working with selenium-webdriver HOT 2
- Error! No available node version satisfies 'node20' HOT 4
- Deprecated subdependencies (babel, npmcli, ts-evaluator, and w3c-hr-time)
- fs.promises.access doesn't work in /snapshot HOT 2
- Error! Not more than one entry file/directory is expected HOT 1
- pkg can't use execFile correctly HOT 1
- notice pkg has a serious bug when we use child_process exec exec,execFile spawn HOT 1
- cpSync with recurse:true results in ENOENT
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pkg.