| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,21 @@ | |||
| 1 | + 'use strict'; | ||
| 2 | + | ||
| 3 | + const common = require('../common'); | ||
| 4 | + | ||
| 5 | + const BASE = 'string\ud801'; | ||
| 6 | + | ||
| 7 | + const bench = common.createBenchmark(main, { | ||
| 8 | + n: [1e5], | ||
| 9 | + size: [10, 100, 500], | ||
| 10 | + }); | ||
| 11 | + | ||
| 12 | + function main({ n, size }) { | ||
| 13 | + const { toUSVString } = require('util'); | ||
| 14 | + const str = BASE.repeat(size); | ||
| 15 | + | ||
| 16 | + bench.start(); | ||
| 17 | + for (let i = 0; i < n; i++) { | ||
| 18 | + toUSVString(str); | ||
| 19 | + } | ||
| 20 | + bench.end(n); | ||
| 21 | + } | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments