-
Notifications
You must be signed in to change notification settings - Fork 159
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
Reduce the number of allocations to reduce garbage collection #348
Comments
Interesting. My guess (which could very well be wrong) is the enormous amount of AST nodes it needs to create when parsing the clang output. I'm in two minds about disabling this on Travis. While it may makes the build faster it also creeps away from the normal commands that would be run. Also if for some reason it allocated a huge amount of memory it would break not only the current build but also potentially all the previous builds (with this change) if we wanted to rerun them. I'd love to know exactly why Go is spending so much time cleaning up in the first place - maybe then we can find genuine performance gains there... I know that @Konstantin8105 has done some awesome work with finding which parts contribute significantly to the CPU. |
I agree that we should fix the problem at the root, i.e. reduce allocations. I am guessing that we have a lot of duplicated strings (identifiers, types, ...) Maybe doing some string interning could be beneficial? golang/go#5160 Will need gather more metrics. |
Few time ago, I test speed of Go on simple math operation - multiplication of matrix(https://github.com/Konstantin8105/Matrix-Multiply-Part1). Ignore my point, if it outside of thread. |
I will try to think about minimize allocation for main.convertLinesToNodesParallel |
May be for more precision- we will create a benchmark test. Feel free for implementation(action). |
Before:
After trying to modify
Result is fail. So, I reject PR. |
Just for information ,
I found only 4...5% of time for GC. |
I ran
GODEBUG=gctrace=1 c2go transpile sqlite3.c
and noticed that the garbage collector is taking 12% of the total run time.Running without the garbage collector showed better performance:
GOGC=off c2go transpile sqlite3.c
See if we can add
GOGC=off
to the integration tests to make them run faster.The text was updated successfully, but these errors were encountered: