datafaker-net / datafaker

Generating fake data for the JVM (Java, Kotlin, Groovy) has never been easier!
https://www.datafaker.net
Apache License 2.0
1.09k stars 151 forks source link

Use cache for fetchObject #1288

Closed snuyanzin closed 5 days ago

snuyanzin commented 5 days ago

This fixes #1285

no need to recalculate same values for different locales

before

Benchmark                                        Mode  Cnt     Score    Error   Units
LocalePerformanceBenchmark.en_fullname          thrpt   10  3160.491 ± 71.525  ops/ms
LocalePerformanceBenchmark.en_gb_fullname       thrpt   10    62.385 ±  6.717  ops/ms
LocalePerformanceBenchmark.en_gb_streetAddress  thrpt   10    46.018 ± 25.115  ops/ms
LocalePerformanceBenchmark.en_streetAddress     thrpt   10  2268.299 ± 37.201  ops/ms

after


Benchmark                                        Mode  Cnt     Score    Error   Units
LocalePerformanceBenchmark.en_fullname          thrpt   10  3168.236 ± 65.091  ops/ms
LocalePerformanceBenchmark.en_gb_fullname       thrpt   10  1829.919 ± 34.379  ops/ms
LocalePerformanceBenchmark.en_gb_streetAddress  thrpt   10  1154.528 ± 43.499  ops/ms
LocalePerformanceBenchmark.en_streetAddress     thrpt   10  2251.981 ± 30.529  ops/ms
codecov-commenter commented 5 days ago

:warning: Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 92.00%. Comparing base (b37c566) to head (ac1deb3). Report is 204 commits behind head on main.

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1288 +/- ## ============================================ - Coverage 92.35% 92.00% -0.35% - Complexity 2821 3087 +266 ============================================ Files 292 310 +18 Lines 5609 6029 +420 Branches 599 628 +29 ============================================ + Hits 5180 5547 +367 - Misses 275 330 +55 + Partials 154 152 -2 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.