Closed gopherbot closed 8 years ago
It seems I'm also running into this problem. It might also have something to do with memory allocations. The amount of allocated memory has grown 4 times from Go 1.3.3 for a benchmark which was using bytes.Buffer.
Other tests and programs have also taken a 20-33% performance hit which might be connected to goroutines, channels and memory allocations.
This makes Go even slower, burdens the garbage collector with more garbage and increases memory usage for everything using Go.
Would anyone from the Go team care to comment on @unclejack's remark?
@unclejack @nkev provide concrete details and we can investigate.
Well, my pretty complex Go program (sorry, it's not open source) consistently completes in about 32 seconds when compiled with Go 1.4.2. Note: the first line of my code is this: runtime.GOMAXPROCS(runtime.NumCPU())
The exact same and unmodified(!) code compiled with Go 1.5 (released today!) not only compiles a bit slower but consistently completes in about 50 seconds on every run.
Platform is Windows 7 (64-bit).
I'm sorry, but I cannot provide example code. My program is highly optimized (I used to write programs in Assembly language before, so I know what I am talking about) and it is a converter program. I use the folllowing 3rd party library extensively: goquery
I was extremely excited that Go 1.5 got released today (was looking for this release for over 2 months) but I'll downgrade back to Go 1.4.2 tomorrow because of this extreme performance degradation...
I am sorry, that I cannot provide the source code of my program, but it is not public. :(
@tssajo I'm sorry that Go 1.5 is causing problems for you. Could I ask you to consider opening a new issue. I understand that you cannot provide the source of your program, but perhaps if you can provide some code derived from your program which demonstrates the issue some progress can be made.
The slowdowns encountered when switching to Go 1.4 from Go 1.3 were pretty difficult to pinpoint. Some were just goroutines behaving differently.
Go 1.5 has made Docker's compilation slower and test execution is also slower.
make binary with Go 1.5 real 0m48.332s user 0m0.420s sys 0m0.992s
make binary with Go 1.4.2 real 0m21.154s user 0m0.832s sys 0m0.692s
make cross with Go 1.5 real 4m1.818s user 0m0.756s sys 0m0.740s
make cross with Go 1.4.2 real 1m44.250s user 0m0.848s sys 0m0.720s
make test-unit with Go 1.5 real 10m0.920s user 0m0.744s sys 0m0.796s
make test-unit with Go 1.4.2 real 1m29.796s user 0m1.116s sys 0m0.824s
I haven't done performance tests for Docker binaries, but that is probably going to be slower as well because Docker has quite a bit of code. This might mean waiting for Go 1.6 and skipping Go 1.5.
Go tip didn't seem to have these issues a few months ago.
Are there any plans to address some of these issues in Go 1.5.x?
I haven't done performance tests for Docker binaries, but that is probably going to be slower as well because Docker has quite a bit of code. This might mean waiting for Go 1.6 and skipping Go 1.5.
Please test and profile to confirm if this is the case. Your make unit-test slowdown looks unexpected. 10m vs 1m30 sounds like a lot more work is being done before the tests start.
Go tip didn't seem to have these issues a few months ago. Are there any plans to address some of these issues in Go 1.5.x?
yes, please log an issue with details of what you are seeing and how to reproduce the issue.
@davecheney Thanks for responding to my slowdown issue. I'm going to do some profiling too. I'll profile both the 1.4.2 and 1.5 generated program code. I try to find out the differences between the two. Fortunately, I can reproduce this issue on every run. I hope I can install both 1.4.2 and 1.5 on the same computer (Windows 7 x64) at the same time... I'll try to send you an update soon.
In addition to the slowdown, every single Windows x64 exe file built with 1.5 is about 500kb larger than the one built with 1.4.2 ... My build command looks like this: go build -ldflags "-s -w"
So the resulting exe files are not just executing slower (in my case), but also 500kb larger as well... :(
@tssajo thanks, and please remember to file a new issue.
In addition to the slowdown, every single Windows x64 exe file built with 1.5 is about 500kb larger than > the one built with 1.4.2 ... My build command looks like this: go build -ldflags "-s -w" So the resulting exe files are not just executing slower (in my case), but also 500kb larger as well... :(
Binary size is not a primary concern for Go development. We know they are large and are trying not to let it get ridiculous, but there is no pressing force to make them as small as possible.
@davecheney New issue is filed as requested: https://github.com/golang/go/issues/12228 with CPU and memory profile info.
Please test and profile to confirm if this is the case. Your make unit-test slowdown looks unexpected. 10m vs 1m30 sounds like a lot more work is being done before the tests start.
@davecheney The unit tests were exactly the same for the two runs. The tests are compiled and then executed for the make test-unit
tests.
I'll provide more details after I track down some some specific regressions. Simply profiling the whole Docker binary won't help because it's huge - millions of small objects are created and freed.
This is blocked on the new compiler back end, which didn't make it into Go 1.6.
I think this is bug can probably be closed. Much happened in Go 1.7: the compiler is faster, binaries are smaller, and generated code is better. See http://dave.cheney.net/2016/04/02/go-1-7-toolchain-improvements
Let's move specific issues to new bugs.
by dippo6905: