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

Use cast to char instead of Math.abs, use value of first symbols for hashcode #531

Merged
merged 1 commit into from
Nov 6, 2022

Conversation

snuyanzin
Copy link
Collaborator

A bit more speed up for net.datafaker.providers.base.Text#text(net.datafaker.providers.base.Text.TextRuleConfig)
before

Benchmark                        Mode  Cnt     Score     Error   Units
DatafakerSimpleMethods.text10   thrpt   10  4360.216 ± 529.892  ops/ms
DatafakerSimpleMethods.text100  thrpt   10   895.668 ±  98.985  ops/ms

after

Benchmark                        Mode  Cnt     Score      Error   Units
DatafakerSimpleMethods.text10   thrpt   10  4997.986 ± 1148.652  ops/ms
DatafakerSimpleMethods.text100  thrpt   10  1168.288 ±  155.656  ops/ms

@codecov-commenter
Copy link

codecov-commenter commented Nov 6, 2022

Codecov Report

Merging #531 (e17aed9) into main (fd8e32b) will increase coverage by 0.06%.
The diff coverage is 85.71%.

@@             Coverage Diff              @@
##               main     #531      +/-   ##
============================================
+ Coverage     91.87%   91.93%   +0.06%     
- Complexity     2358     2360       +2     
============================================
  Files           247      247              
  Lines          4947     4947              
  Branches        530      530              
============================================
+ Hits           4545     4548       +3     
+ Misses          273      268       -5     
- Partials        129      131       +2     
Impacted Files Coverage Δ
...c/main/java/net/datafaker/providers/base/Text.java 66.66% <83.33%> (ø)
...main/java/net/datafaker/service/RandomService.java 94.73% <100.00%> (ø)
.../main/java/net/datafaker/service/FakerContext.java 87.17% <0.00%> (+2.56%) ⬆️
...ker/idnumbers/pt/br/IdNumberGeneratorPtBrUtil.java 96.29% <0.00%> (+3.70%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

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

2 participants