-
Notifications
You must be signed in to change notification settings - Fork 156
Collector refactoring, part 2 #1440
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
Conversation
802f6a5
to
50bfec7
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.
This seems like a good refactoring. I tend to prefer medium size files (as opposed to the long files we had before or another approach where we have one file per type), and this seems to strike a good balance.
I'm interested what others have to say.
I don't mind longer files, e.g. anything less than 2,000 lines and I don't bat an eyelid. So a lot of this doesn't feel that necessary to me. But I also won't stand in the way, particular given that Jakub (presumably) thinks this will help with the addition of runtime benchmarks. |
It wasn't necessarily only the length that was annoying to me. The main issue for me was that some modules were included from the binary instead of the library root (this was annoying especially for the Profile and Scenario enums, which are used all over the place and prohibited using collector as a library properly). Also, some files were a bit too overarching. A 2k line file is fine if it cares about a single area, but less so if it spans X (only semi-)related things that could be its own modules. |
…`All` match arms
… `All` match arms
50bfec7
to
5a12bc5
Compare
Now the
collector
crate has a reasonable module layout (at least to my taste), the largest files were split and all modules are under the library root, thecollector
binary only uses them. There is of course still a lot of legacy cruft in some of the interfaces, but I think that for now the refactoring effort is mostly completed from my side. I'll send more patches if needed for runtime benchmarks or benchmark error reporting.