From: Dmitry Volyntsev Date: Tue, 8 Jun 2021 18:01:25 +0000 (+0000) Subject: Added benchmarks for String.prototype.split(). X-Git-Tag: 0.6.0~6 X-Git-Url: http://www.kaiwu.me/postgresql/commit/static/gitweb.js?a=commitdiff_plain;h=8479c41b18ca3632a201749da098a3c67e9bb143;p=njs.git Added benchmarks for String.prototype.split(). --- diff --git a/src/test/njs_benchmark.c b/src/test/njs_benchmark.c index bbe052d5..ff8f3807 100644 --- a/src/test/njs_benchmark.c +++ b/src/test/njs_benchmark.c @@ -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"),