vzhou842 / faster.js Goto Github PK
View Code? Open in Web Editor NEWfaster.js is a Babel plugin that compiles idiomatic Javascript to faster, micro-optimized Javascript.
Home Page: https://www.npmjs.com/package/faster.js
License: MIT License
faster.js is a Babel plugin that compiles idiomatic Javascript to faster, micro-optimized Javascript.
Home Page: https://www.npmjs.com/package/faster.js
License: MIT License
尝试了设置babel/plugins都没有效果
Benchmarks are currently only run in Node. Running the benchmarks in Headless Chrome is closer to actual use environments for faster.js-compiled code.
You'd probably get even better results if you remove the function calls within loop. You have to be careful about inserted identifiers and such, but it should be fairly easy to generate this:
// Compiled with faster.js
const arr = [1, 2, 3];
const results = [];
for (let _i = 0; _i < arr.length; _i++) {
results.push(2 * arr[_i]);
}
Maybe you could even preallocate results
in case of .map
based on arr.length
, but aint sure what's better in majority of use cases. Maybe you could decide about this based on this comment from v8 team.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.