Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fixup! lib: add ASCII fast path to getStringWidth()
  • Loading branch information
addaleax committed Aug 30, 2019
commit 1a90c4cf5710644198230f6c8e5b38feceae7e09
3 changes: 2 additions & 1 deletion benchmark/misc/getstringwidth.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
const common = require('../common.js');

const bench = common.createBenchmark(main, {
type: ['ascii', 'emojiseq', 'fullwidth'],
type: ['ascii', 'mixed', 'emojiseq', 'fullwidth'],
n: [10e4]
}, {
flags: ['--expose-internals']
Expand All @@ -14,6 +14,7 @@ function main({ n, type }) {

const str = ({
ascii: 'foobar'.repeat(100),
Comment thread
addaleax marked this conversation as resolved.
mixed: 'foo'.repeat(100) + '😀' + 'bar'.repeat(100),
emojiseq: '👨‍👨‍👧‍👦👨‍👩‍👦‍👦👨‍👩‍👧‍👧👩‍👩‍👧‍👦'.repeat(10),
fullwidth: '你好'.repeat(150)
})[type];
Expand Down