Move id number objects to final fields to decrease number of object creations#379
Move id number objects to final fields to decrease number of object creations#379snuyanzin merged 1 commit intodatafaker-net:mainfrom
Conversation
Codecov Report
@@ Coverage Diff @@
## main #379 +/- ##
============================================
- Coverage 93.68% 93.68% -0.01%
Complexity 1951 1951
============================================
Files 215 215
Lines 3946 3942 -4
Branches 385 385
============================================
- Hits 3697 3693 -4
Misses 149 149
Partials 100 100
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
|
Wouldn't this increase the number of object creations in most cases? If it's really important, you could create them lazily. Also, is the number of object creations really relevant? (Don't get me wrong, I don't mind the PR at all of course, I'm just wondering if it improves things really) |
|
oops, sorry I noticed your comment after merging... |
No issue at all. I don't think it has to be lazy at all, it's only 6 objects, and creating them is super fast. Using lazy might result into concurrency issues etc, , so I don't think I'd go for that. |
The PR reduces creation of id related objects