Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Binary Reader performance improvement #647

Merged
merged 3 commits into from
Nov 21, 2020

Conversation

desaikd
Copy link
Contributor

@desaikd desaikd commented Nov 20, 2020

Description of changes:
This PR is created to improve binary reader and parser performance.

Changes:

  1. IonBinaryReader: removed duplicate maxId check from getSymbolString().
  2. IonParserBinaryRaw: Use bit shift for multiplication for numberOfBytes less than 4 in _readUnsignedIntAsNumberFrom().

Test:
Verified performance using benchmarkjs and flame graphs from v8 profiling with large binary ion file as input.

Test Results:
Here times are measured using mean time of sample runs while Benchmarking(secs)

Time(before enhancement) Possible enhancement Time (after enhancement) % decrease in Time
10.4261319358 IonBinaryReader (removed duplicate condition checks) 9.9510428 4.556715172274926
10.3857747234 IonParserBinaryRaw (using bitshift for multiplication) 10.3409678528 0.431425404395172
10.5577046098 Both improvements together 9.9062553234 6.170368564728586

@zslayton
Copy link
Contributor

Per offline conversation, the ion-test-driver build is currently failing because ion-test-driver does an error message equality check on an Error that this PR changes.

@desaikd desaikd merged commit f66d154 into amazon-ion:master Nov 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants