mirror of
https://github.com/wavetermdev/xterm.js.git
synced 2026-08-05 13:43:48 -07:00
test speedup defensive
This commit is contained in:
@@ -163,7 +163,7 @@ describe('wcwidth', () => {
|
||||
assert.equal(wcwidth(0x30000), old_wcwidth(0x30000));
|
||||
assert.equal(wcwidth(0x3fffe), old_wcwidth(0x3fffe));
|
||||
});
|
||||
it('new is at least 10 times faster', () => {
|
||||
it('new is at least 5 times faster', () => {
|
||||
let start_new = new Date().getTime();
|
||||
let x = 0;
|
||||
for (let runs = 0; runs < 1; ++runs)
|
||||
@@ -176,6 +176,8 @@ describe('wcwidth', () => {
|
||||
for (let i = 0; i < 65536; ++i)
|
||||
y = old_wcwidth(i);
|
||||
let end_old = new Date().getTime();
|
||||
assert.equal(((end_new - start_new) * 10 < (end_old - start_old)), true);
|
||||
//console.log((end_new - start_new));
|
||||
//console.log((end_old - start_old));
|
||||
assert.equal(((end_new - start_new) * 5 < (end_old - start_old)), true);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user