Coder Social home page Coder Social logo

Comments (3)

guybedford avatar guybedford commented on July 30, 2024

There has been previous discussion on this topic in guybedford/es-module-lexer#38.

The short of it though is that for smaller source files (under 500KB), the sync processing really is fastest since context switching costs would be more than just finishing the parse which is really quite fast.

The first step to take if we deem performance to be an issue (which already it is highly optimized), would be to use the native C version of this library instead of the JS version. There is a bit of work needed to land this though to the quality of C code needed in Node.js core. But that would get roughly a 1.5x speed improvement.

After that the next thing is optimizing the actual calls even further to find the bottlenecks.

After all that is done, I would rather consult those who are experts on C++ performance to see what next steps might be. I don't get the impression though that streaming would be on the list there.

from cjs-module-lexer.

aduh95 avatar aduh95 commented on July 30, 2024

OK thanks for the info, good to know it's already been thought through.

But that would get roughly a 1.5x speed improvement.

According to the readme, WASM version is 1.5x the speed of JS; would that make the C version 2.25x faster than the JS version or do you mean C perf are roughly the same as WASM? Not that it matters here, I'm just wondering.

from cjs-module-lexer.

guybedford avatar guybedford commented on July 30, 2024

Yes, actually the C version would likely be another 1.5x the speed of Wasm so you are probably right!

from cjs-module-lexer.

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.