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

Fast assembly conversion to hex string #100

Merged
merged 1 commit into from Nov 14, 2018

Conversation

Projects
None yet
2 participants
@tlecomte

tlecomte commented Nov 14, 2018

On a test database, OpenDBDiff is taking 27% of its runtime in GenerateAssemblies:Fill. Most of this time is taken to convert the assembly bytes to a hex string. Here this code is optimized with a lookup technique. After the change, GenerateAssemblies:Fill only takes 3% of the total runtime.

Reference for hex encoding performance: https://stackoverflow.com/questions/311165/how-do-you-convert-a-byte-array-to-a-hexadecimal-string-and-vice-versa

Timothée Lecomte
Fast assembly conversion to hex string
On a test database, OpenDBDiff is taking 27% of its runtime in GenerateAssemblies:Fill. Most of this time is taken to convert the assembly bytes to a hex string. Here this code is optimized with a lookup technique. After the change, GenerateAssemblies:Fill only takes 3% of the total runtime.

Reference for hex encoding performance: https://stackoverflow.com/questions/311165/how-do-you-convert-a-byte-array-to-a-hexadecimal-string-and-vice-versa
@igitur

igitur approved these changes Nov 14, 2018

Good find. I could use this in other projects too :-)

@igitur igitur merged commit b30ead3 into OpenDBDiff:develop Nov 14, 2018

1 check passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment