-
Notifications
You must be signed in to change notification settings - Fork 2
Burkland/split up main source file #170
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
Burkland/split up main source file #170
Conversation
…ecific functions as static inline
@chaburkland : very happy to see this refactoring! One initial comment: I would favor leaving in the existing
|
@chaburkland : one more: Can we name |
Thanks for the push to rename. I wasn't sure what to call it, but As for I wasn't able to mark these 4 functions |
I think (at least an AI told me) if we put the actual implementation (not just the header) in the |
@chaburkland : any thoughts on the above (putting implementations in header files for inlining)? Also, do you think we should merge this before merging #160, or vice versa? |
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 such a long-overdue improvement!
A first pass at splitting up
_arraykit.c
into multiple source files.I split it up as such:
utilities.c
: defines internal arraykit functions/macros that are used by other functions across multiple modulesmethods.c
: defines the public arraykit functionsblock_index.c
: defines allBlockIndex
related codearray_go.c
: defines allArrayGO
related codefile_parsing.c
: defines all code related to delimited file parsingtri_map.c
: defines allTriMap
related code_arraykit
: defines thearraykit
public interfaceAll source files, except
_arraykit.c
have related header files.A main note
Many functions are no longer
static
orstatic inline
. Through splitting this code up, I gained a deeper understanding of what those keywords mean.static
means the function defined is specific to the scope of the source file it lives in. As such, it is non-sensical to define astatic
function in a header file, because it is essentially defining an interface that cannot ever be referenced outside the header file itself. As such, the public functions/typedefs in each of the header files are not static, and their corresponding definitions in the source files are also not static.inline
is a way to speed up performance at the cost of binary size.With inlining all possible functions, the binary sizes (on my machine) increases from:
841,184 KBs
->1,041,664 KBs
I'm testing the performance diff now