Thanks to visit codestin.com
Credit goes to github.com

Skip to content

check unexpected high bits for invalid characters#173

Merged
dcousens merged 3 commits into
masterfrom
chk
Feb 1, 2018
Merged

check unexpected high bits for invalid characters#173
dcousens merged 3 commits into
masterfrom
chk

Conversation

@dcousens

@dcousens dcousens commented Nov 30, 2017

Copy link
Copy Markdown
Contributor

10% performance drop, but 200% better debuggability.

Hopefully this resolves that problem @indutny

@dcousens

dcousens commented Nov 30, 2017

Copy link
Copy Markdown
Contributor Author

passes tests now

Comment thread test/constructor-test.js
'0000gg00',
'ffffggff',
'ffffggff',
'hexadecimal'

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's add ., -, /. They all come before 0 in ASCII.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@indutny added, and it passes!

@indutny

indutny commented Dec 2, 2017

Copy link
Copy Markdown
Owner

Sorry for delay. I just benchmarked it, and don't see any significant performance improvement. Do you see it on your side?


Benchmarks can be run with:

SELF_ONLY=1 node benchmarks/index.js create

@dcousens

dcousens commented Dec 4, 2017

Copy link
Copy Markdown
Contributor Author

I measured an average 5-10% improvement... but [assumedly] the GC totally throws it off, and I often measure +/-20% swings for both depending on their order in the benchmark stack.

@fanatid

fanatid commented Dec 5, 2017

Copy link
Copy Markdown
Collaborator

node version: v9.2.0

master:

Seed: 82910582182c79d7d4d9592e15d53f0d
Benchmarking: create-10
bn.js#create-10 x 376,678 ops/sec ±1.55% (9 runs sampled)
------------------------
Fastest is bn.js#create-10
========================
Benchmarking: create-hex
bn.js#create-hex x 478,025 ops/sec ±1.02% (9 runs sampled)
------------------------
Fastest is bn.js#create-hex
========================

PR:

Seed: 82910582182c79d7d4d9592e15d53f0d
Benchmarking: create-10
bn.js#create-10 x 383,537 ops/sec ±0.90% (9 runs sampled)
------------------------
Fastest is bn.js#create-10
========================
Benchmarking: create-hex
bn.js#create-hex x 489,839 ops/sec ±0.37% (9 runs sampled)
------------------------
Fastest is bn.js#create-hex
========================

@dcousens

dcousens commented Dec 5, 2017

Copy link
Copy Markdown
Contributor Author

@fanatid how did you get consistent results :P

@fanatid

fanatid commented Dec 5, 2017

Copy link
Copy Markdown
Collaborator

Sorry, was run with different seed, numbers updated.

@dcousens

dcousens commented Feb 1, 2018

Copy link
Copy Markdown
Contributor Author

@indutny good to merge? If not, I'll simply add the test?

@indutny indutny left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, sorry for delay.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants