-
Notifications
You must be signed in to change notification settings - Fork 722
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
cardano-tracer: Lower allocation by persisting file handles #5677
Conversation
453b995
to
9cd1b75
Compare
3cb8e1f
to
08e4e24
Compare
e7a888e
to
c8c3a0f
Compare
4b45f45
to
ac3b91f
Compare
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.
Great @Icelandjack thank you!
ac3b91f
to
1591132
Compare
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 GHC.IO.Handle has hFileSize as a more direct equivalent of getFileSize (fstat vs. stat vs. lseek(fd, 0, SEEK_CUR) etc.). In principle, the handle could have seeked within the file, though append mode pins the position to the end of the file. It doesn't necessarily need anything to be changed, but I thought about it while reviewing.
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.
Looks good!!!
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.
This is shockingly clean code!
Description
Add Handle Registry feature to the
TracerEnv
, to track handles that have been opened.Checklist
See Runnings tests for more details
CHANGELOG.md
for affected package.cabal
files are updatedhlint
. See.github/workflows/check-hlint.yml
to get thehlint
versionstylish-haskell
. See.github/workflows/stylish-haskell.yml
to get thestylish-haskell
versionghc-8.10.7
andghc-9.2.7
Graphs
RTS allocation rate:
RTS live dataset:
Profiling comparison (
tracer/cardano-tracer.gcstats
)Compiled with
WB_PROFILING=time
Without Handle Registry (old)
With Handle Registry (new):
Compiled with
WB_PROFILING=time-detail
Without Handle Registry (old)
With Handle Registry (new)