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

Speed up hex by using getRandomByteArray #510

Merged
merged 1 commit into from
Nov 1, 2022

Conversation

snuyanzin
Copy link
Collaborator

The same approach as in #508
the same assumption
number of different digits is less then size of byte range and it is ok (16 vs 256)
So this allows it to speed up for about 30-40%
digitByDigit1 - current approach for 1 digit
digitByDigit10 - current approach for 10 digits
digitByDigit100 - current approach for 100 digits
and etc.

Benchmark            Mode  Cnt       Score       Error   Units
byteArrayBased1     thrpt   10  119909.324 ±   972.720  ops/ms
byteArrayBased10    thrpt   10   28427.346 ±  5152.356  ops/ms
byteArrayBased100   thrpt   10    4350.995 ±   276.395  ops/ms
byteArrayBased1000  thrpt   10     391.391 ±    55.684  ops/ms
digitByDigit1       thrpt   10   76420.584 ± 11843.538  ops/ms
digitByDigit10      thrpt   10   12479.871 ±   706.021  ops/ms
digitByDigit100     thrpt   10    1444.884 ±     9.320  ops/ms
digitByDigit1000    thrpt   10     143.684 ±     2.113  ops/ms

@snuyanzin snuyanzin merged commit fdafe04 into datafaker-net:main Nov 1, 2022
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.

1 participant