It had been a while since the latest version of Node.js 12 was released with the codename of Erbium. It brings with it tonnes of new features like diagnostic reports, bundled heap dump capabilities, as well as updates to the Worker Thread and N-API. There are a few transitions that can include several notable changes like the individual release notes from Node.js 11.0.0 to 12.12.0 and on a higher level too.
- Faster, seamless execution
- Advanced memory management
- Wider ECMAScript syntax support
Async stack traces
The new feature known as the zero-cost async stack helps in the tracing and enriching of the error.stack along with the asynchronous call frames. You can find it behind the async-stack-traces command-line option.
Quicker async/await execution
In a case when the engine deems arguments adaption irrelevant because of the callee originating from a strict mode function, V8 would now skip the process and thus decrease the call overhead by as much as 60%.
The above graph depicts how in case of an argument mismatch there’s an absence of overhead.
Apart from the async/await implementation, there are many new updates that can be seen in the public class fields. To define the different class levels, you can list all variables with default values in the constructor. Here’s how:
As shown above, you can choose not to include any parameter in the function or completely focus on the required variables upon initialization.
For the private class fields (the much-awaited), if you need to mark the fields as private you can begin with naming the fields with a hashtag (#).
According to the recent discovery made by the Angular team, it shows that when you call DOM property accessors with the help of get functions via the monomorphic or megamorphic get functions, the time taken to the process was slower in Chrome. It’s because of the slow-path route used in V8 for calling DOM accessors via the Function#call() than that of the fast-path.
The worker threads in Chrome get streamed (another term for being parsed) as they get downloaded. In V8, the issues with UTF-8 decoding have been resolved resulting in 8% faster streaming. The preparser issue of property names getting deduplicated was also corrected, thus contributing to the performance by 10.5%
Configuration of default heap limits
The default heap dumps can now be reconfigured based upon the available memory rather than going by the defaults assigned to V8. The previous releases witnessed V8 considering the max heap size to 700MB or 1400MB respectively with 32-bit and 64-bit platforms, without any configuration, that made the process time-taking and exhaustive in nature. The recent improvement of reconfiguring the heap size based on available memory reduces any such memory strains and in the quick execution of the process, especially for massive datasets.
Switching of Default HTTP parser to llhttp
The Node.js 12 update also comes with a default switching parser that is needed for testing and comparing the new llhttp-based implementation quicker and seamless.
Improved Diagnostic Reports
Though present in an experimental state, the ‘Diagnostic report’ may help the users to have a detailed look into any change of events that take place in the system. Such reports may contain credible information that may help to early identification of production problems or bottlenecks such as CPU overuse, unknown errors, probable crashes, etc.
Generation of Code Cache in Build Time
Support for ES6 Modules
It is an experimental step that comes with the latest update of Node.js 12 for giving a crucial head start in collaborative implementation.
Compiler and Platform Optimizations
Node.js and V8 combined the newest features of compiler optimizations and security enhancements now require a minimum of GCC6 and Glibc 2.17 to function on any other platform except macOS and Windows. Such a toolchain prerequisite comes with a new compile-time performance for the Node.js binaries.
That’s not all, as the platforms using Glibc (other than macOS and Windows) would now include a minimum version of 2.17 and for the common Linux environments compatible with the new version must include Enterprise Linux 7 (RHEL and CentOS), Debian 8, and Ubuntu 14.04.
Node.js 12 isn’t just any ordinary release; instead, this LTS release comes with heaps of optimizations. Node.js 12 now can provide ABI compatibility and work in several Node VMs.
In case you’re a software professional looking for in-demand opportunities to checkout, here are a few recommendations:
They’re a Mumbai-based cloud transformation and consulting enterprise with signatures across the Middle East and South Asia. They provide expertise in fueling tech-backed, digital transformation across healthcare, manufacturing, and retail. They’re looking for Angular, .Net developers, and numerous other work profiles.
An award-winning, end-to-end web, software, and eCommerce development enterprise, their ever-growing team consists of 400+ professionals and more. If you’re looking for software testing jobs in Kolkata, they’re a great place to get a headstart in your career path, as you learn and grow with them.
Folks here are committed to delivering tech-backed, advanced web and mobile solutions for health, edu-tech, eCommerce, and other industries. They’re hiring for multiple roles, including full-stack developer in Python leads, having relevant industry experience.