Deno 1.26 improves text encoding and file processing performance, and strengthens support for Node.js | iThome

by time news

The JavaScript and TypeScript execution environment Deno has released the latest version 1.26. The update of this version focuses not only on performance improvement, but also on improving the compatibility between Node.js and NPM. According to the official announcement, the performance improvement work they have been working on internally will reduce latency and processing overhead by solving bottlenecks, and the full results will be released in the near future.

However, compared with version 1.24.3, Deno 1.26 has made some preliminary progress in the performance improvement part, such as encoding text into the existing TypedArray, the maximum throughput of small loads has been increased to 5 times, and the maximum payload of larger payloads has been increased to 5 times. It is increased to 30 times, and the speed of synchronous writing to Deno.writeFileSync() is also increased by 1.44 times, and the speed of asynchronous writing to Deno.writeFile() is also slightly increased by 1.15 times.

Previously, the CSV parsing performance was reduced due to the official change of the Deno text decoding method, but now the official has begun to improve it. In the benchmark test, this version has a performance improvement of 1.36 times on Mac and a speedup of 1.19 times on Linux. In addition, the parsing speed of URLs without query strings is now increased by 2.27 times, and the parsing speed of complex URLs with multiple query string parameters is also increased by 1.37 times.

The development team has made many improvements to Deno’s file system operations. Compared with version 1.24.3, the performance of many file operations has been improved by different degrees (below). On MacOS, Deno.copyFileSync will use APFS as much as possible when writing. Duplicate this system call for optimal strategy.

Image credit / Deno Land

Deno 1.26 adds several API implementations that were not previously supported in the Node.js compatibility layer. In addition, the test suite for the entire compatibility layer has been updated. Previously, the test suite only supported Node.js 16.13.0, and now it has been Compatible with Node.js 18.8.0, the official explanation is that this work is to prepare for Node.js 18 to enter long-term support in October.

The Node.js streaming implementation in Deno has been updated to use the [email protected] NPM module, this update will allow Deno to better keep up with major updates. Deno adds support for the cache API in this version, which allows developers to cache request/response objects. The development team mentioned that this feature is very helpful when dynamically generating responses, allowing developers to cache GET requests. Responses, and provide responses to similar requests from the cache. Deno 1.26 also ships with the latest TypeScript stable version 4.8.

You may also like

Leave a Comment