Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
runtime: goroutine heavy Go program faster when printing, slower when not #20788
I'm encountering a weird performance behaviour with Go, possibly due to Go's goroutine scheduler.
Here's my code: https://play.golang.org/p/a1464VZuIb
I'm sorry if it's a bit long, but I couldn't replicate this behaviour with anything shorter. The code basically generates all logic expressions with not and implication logic operators given a certain sequence of logic variables. It does so using goroutines as iterators and recursion. Then it prints all of the tautologies among them.
The bug is that when I comment out the
I am using:
Ok, so I tried with go1.9beta1 and yes, I can replicate it, but I figured that it only happens in VSCode terminal. When I run the program in normal terminal outside VSCode, the performance is as expected. But inside the VSCode terminal, the performance with printing is faster. This is probably not serious, but very mysterious anyway.