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

Preload classes and methods while parsing yaml #597

Merged
merged 1 commit into from
Jan 9, 2023

Conversation

snuyanzin
Copy link
Collaborator

@snuyanzin snuyanzin commented Jan 9, 2023

This is a small optimization which allows to speed up a bit nested expressions e.g.

street_name:
        - "#{Name.first_name} #{street_suffix}"
        - "#{Name.last_name} #{street_suffix}"

before

Benchmark                              Mode  Cnt    Score   Error   Units
DatafakerSimpleMethods.streetAddress  thrpt   10  551.874 ± 7.358  ops/ms

after

DatafakerSimpleMethods.streetAddress  thrpt   10   682.915 ±  5.474  ops/ms

@codecov-commenter
Copy link

Codecov Report

Merging #597 (11d209f) into main (72b8d7e) will decrease coverage by 0.30%.
The diff coverage is 76.11%.

@@             Coverage Diff              @@
##               main     #597      +/-   ##
============================================
- Coverage     93.15%   92.85%   -0.31%     
- Complexity     2445     2463      +18     
============================================
  Files           252      252              
  Lines          5097     5148      +51     
  Branches        562      580      +18     
============================================
+ Hits           4748     4780      +32     
- Misses          211      220       +9     
- Partials        138      148      +10     
Impacted Files Coverage Δ
.../java/net/datafaker/service/FakeValuesService.java 84.92% <71.42%> (-0.83%) ⬇️
...n/java/net/datafaker/providers/base/BaseFaker.java 87.82% <75.00%> (-6.23%) ⬇️
...rc/main/java/net/datafaker/service/FakeValues.java 83.19% <90.00%> (+0.15%) ⬆️
...ain/java/net/datafaker/idnumbers/EnZAIdNumber.java 83.33% <0.00%> (-8.34%) ⬇️
.../main/java/net/datafaker/service/FakerContext.java 92.30% <0.00%> (+2.56%) ⬆️

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

@snuyanzin snuyanzin merged commit 01bc1fc into datafaker-net:main Jan 9, 2023
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