Newsletter

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

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

However, compared to version 1.24.3, Deno 1.26 has made some preliminary progress in the performance improvement part, such as text encoding to the existing TypedArray, the maximum throughput of small loads has been increased to 5 times, and the maximum payload of more. payloads have 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 performance of CSV parsing was reduced due to the official change of Deno text decoding method, but now the official has started to improve it. In the benchmark test, this version has a performance improvement of 1.36 times on Mac and a speed 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 to version 1.24.3, the performance of many file operations has been improved to varying degrees (below). On MacOS, Deno.copyFileSync will uses APFS as much as possible when Duplicate this system call for the best strategy.

Image credit / Deno Land

Deno 1.26 adds a number of API implementations that were not previously supported in the Node.js compatibility layer. Additionally, 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 readable-stream@4.1.0 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 useful in dynamically generating responses, allowing developers to cache GET requests. Responses, and providing responses to similar requests from the store. Deno 1.26 also ships with the latest TypeScript stable version 4.8.