Giter Club home page Giter Club logo

Comments (7)

rla avatar rla commented on June 20, 2024 3

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.

igorklopov avatar igorklopov commented on June 20, 2024 1

@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.

vmakarevich-sugarcrm avatar vmakarevich-sugarcrm commented on June 20, 2024

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.

igorklopov avatar igorklopov commented on June 20, 2024

Good job, @rla! I will try to address that slowdown.

from pkg.

rla avatar rla commented on June 20, 2024

@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.

igorklopov avatar igorklopov commented on June 20, 2024

Right! Thanks! πŸ‘

from pkg.

leerob avatar leerob commented on June 20, 2024

Closing this as stale πŸ™ Thank you anyway!

from pkg.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.