���� JFIF �� � ( %"1"%)+...383,7(-.-
![]() Server : Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.4.20 System : Linux st2.domain.com 3.10.0-1127.10.1.el7.x86_64 #1 SMP Wed Jun 3 14:28:03 UTC 2020 x86_64 User : apache ( 48) PHP Version : 7.4.20 Disable Function : NONE Directory : /proc/self/root/home/real/node-v13.0.1/benchmark/util/ |
'use strict'; const util = require('util'); const common = require('../common'); const inputs = { 'string': ['Hello, my name is %s', 'Fred'], 'string-2': ['Hello, %s is my name', 'Fred'], 'number': ['Hi, I was born in %d', 1989], 'replace-object': ['An error occurred %j', { msg: 'This is an error' }], 'unknown': ['hello %a', 'test'], 'no-replace': [1, 2], 'no-replace-2': ['foobar', 'yeah', 'mensch', 5], 'only-objects': [{ msg: 'This is an error' }, { msg: 'This is an error' }], 'many-%': ['replace%%%%s%%%%many%s%s%s', 'percent'], }; const bench = common.createBenchmark(main, { n: [1e5], type: Object.keys(inputs) }); function main({ n, type }) { // For testing, if supplied with an empty type, default to string. const [first, second] = inputs[type || 'string']; bench.start(); for (let i = 0; i < n; i++) { util.format(first, second); } bench.end(n); }