Skip to content
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

Move large functions to .cpp files #2457

Merged
merged 1 commit into from
Mar 22, 2023

Conversation

scarf005
Copy link
Member

Summary

SUMMARY: Build "Move large functions to .cpp files"

Purpose of change

reduce large header sizes.

Describe the solution

manually moved implementation to cpp files using C-mantic vscode extension.

Describe alternatives you've considered

keep them as-is, to be honest i'm not sure if build time is reduced at all.

Testing

tested using cmake + ninja, compiled without error.

@github-actions github-actions bot added the src changes related to source code. label Mar 21, 2023
Copy link
Contributor

@olanti-p olanti-p left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If my estimations are correct, this reduced total amount of compiled code by 50k LoC (approx. 0.9%).
Still, I think this is good from the de-bloating point of view.

@scarf005
Copy link
Member Author

that's nice. may i ask which method did you use to calculate the result? maybe i should find and move more function body.

@olanti-p
Copy link
Contributor

It's from a script I wrote back when I was optimizing headers in BN
https://github.com/olanti-p/simple_include_counter
It gives an estimate of how many source lines of code (excluding system and std includes) the compiler has to churn through.

@olanti-p olanti-p merged commit 88761c2 into cataclysmbnteam:upload Mar 22, 2023
@scarf005 scarf005 deleted the large-functions branch March 22, 2023 22:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
src changes related to source code.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants