Welcome! Log In Create A New Profile

Advanced

[njs] Added benchmarks for String.prototype.split().

Dmitry Volyntsev
June 09, 2021 01:56PM
details: https://hg.nginx.org/njs/rev/5516f717a8c9
branches:
changeset: 1655:5516f717a8c9
user: Dmitry Volyntsev <xeioex@nginx.com>
date: Tue Jun 08 18:01:25 2021 +0000
description:
Added benchmarks for String.prototype.split().

diffstat:

src/test/njs_benchmark.c | 15 +++++++++++++++
1 files changed, 15 insertions(+), 0 deletions(-)

diffs (25 lines):

diff -r 913a69870b49 -r 5516f717a8c9 src/test/njs_benchmark.c
--- a/src/test/njs_benchmark.c Sat Jun 05 11:55:08 2021 +0000
+++ b/src/test/njs_benchmark.c Tue Jun 08 18:01:25 2021 +0000
@@ -316,6 +316,21 @@ static njs_benchmark_test_t njs_test[]
njs_str("undefined"),
1 },

+ { "regexp split",
+ njs_str("'a a'.split(/ /).length"),
+ njs_str("2"),
+ 100 },
+
+ { "regexp 10K split",
+ njs_str("'a '.repeat(10000).split(/ /).length"),
+ njs_str("10001"),
+ 1 },
+
+ { "simple 100K split",
+ njs_str("'a '.repeat(100000).split(' ').length"),
+ njs_str("100001"),
+ 1 },
+
{ "external property ($shared.uri)",
njs_str("$shared.uri"),
njs_str("shared"),
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[njs] Added benchmarks for String.prototype.split().

Dmitry Volyntsev 121 June 09, 2021 01:56PM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 62
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready