11cb0ef41Sopenharmony_ci'use strict';
21cb0ef41Sopenharmony_ciconst common = require('../common.js');
31cb0ef41Sopenharmony_ciconst querystring = require('querystring');
41cb0ef41Sopenharmony_ci
51cb0ef41Sopenharmony_ciconst bench = common.createBenchmark(main, {
61cb0ef41Sopenharmony_ci  input: [
71cb0ef41Sopenharmony_ci    'there is nothing to unescape here',
81cb0ef41Sopenharmony_ci    'there%20are%20several%20spaces%20that%20need%20to%20be%20unescaped',
91cb0ef41Sopenharmony_ci    'there%2Qare%0-fake%escaped values in%%%%this%9Hstring',
101cb0ef41Sopenharmony_ci    '%20%21%22%23%24%25%26%27%28%29%2A%2B%2C%2D%2E%2F%30%31%32%33%34%35%36%37',
111cb0ef41Sopenharmony_ci  ],
121cb0ef41Sopenharmony_ci  n: [10e6],
131cb0ef41Sopenharmony_ci});
141cb0ef41Sopenharmony_ci
151cb0ef41Sopenharmony_cifunction main({ input, n }) {
161cb0ef41Sopenharmony_ci  bench.start();
171cb0ef41Sopenharmony_ci  for (let i = 0; i < n; i += 1)
181cb0ef41Sopenharmony_ci    querystring.unescapeBuffer(input);
191cb0ef41Sopenharmony_ci  bench.end(n);
201cb0ef41Sopenharmony_ci}
21