-
Notifications
You must be signed in to change notification settings - Fork 272
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
Create a fresh ArrayEventContainer for each event in SimTelEventSource #1952
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah if there is no performance impact, this is definitely a good idea. all there reuse was originally just for performance, but i have to admit i never measured it.
i’m considering even replacing the current Container implementation with a dataclass based one, with frozen attributes. I tried it and it seems to be must as fast and would prevent most accidental changes if we’re required to fill all containers at creation time
Codecov Report
@@ Coverage Diff @@
## master #1952 +/- ##
==========================================
- Coverage 92.20% 92.20% -0.01%
==========================================
Files 193 193
Lines 15216 15203 -13
==========================================
- Hits 14030 14018 -12
+ Misses 1186 1185 -1
Continue to review full report at Codecov.
|
That won't have all our features like prefixes / data types / help strings etc. dataclasses are a very powerful code generator, but in the end you get normal python classes with some fields. We have our own code generator here (that's essentially what the E.g. we have |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is a good idea.
Avoids all the subtle bugs with reused information
Seems to have no impact on performance:
This branch:
Master:
I was bitten by the reuse of the container again, this time it was DL2 information from the previous events not being cleared.