rsnext/test/e2e/app-dir/app-routes
Quentin abe8b1e0a8
Improve performance of String.prototype.split uses (#56746)
This PR adds the optional `limit` parameter on String.prototype.split uses.

> If provided, splits the string at each occurrence of the specified separator, but stops when limit entries have been placed in the array. Any leftover text is not included in the array at all.

[MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/split#syntax)

While the performance gain may not be significant for small texts, it can be huge for large ones.

I made a benchmark on the following repository : https://github.com/Yovach/benchmark-nodejs

On my machine, I get the following results:
`node index.js`
> normal 1: 570.092ms
> normal 50: 2.284s
> normal 100: 3.543s

`node index-optimized.js`
> optmized 1: 644.301ms
> optmized 50: 929.39ms
> optmized 100: 1.020s

The "benchmarks" numbers are : 
- "lorem-1" file contains 1 paragraph of "lorem ipsum"
- "lorem-50" file contains 50 paragraphes of "lorem ipsum"
- "lorem-100" file contains 100 paragraphes of "lorem ipsum"
2023-10-19 00:25:15 +00:00
..
app Make permanentRedirect return 308 in route handlers (#56065) 2023-09-27 10:28:30 +00:00
handlers Ensure WebSocket is polyfilled for node runtime as well (#48924) 2023-04-28 15:48:14 -05:00
app-custom-route-base-path.test.ts Support basePath with edge runtime for Custom App Routes (#52910) 2023-07-19 23:54:34 +00:00
app-custom-routes.test.ts Improve performance of String.prototype.split uses (#56746) 2023-10-19 00:25:15 +00:00
helpers.ts Loose types of app routes return value (#55849) 2023-09-25 11:34:21 +02:00
next.config.js Loose types of app routes return value (#55849) 2023-09-25 11:34:21 +02:00