How does Java do without using an array of ints, or Valhalla? In other words, what's the cost of Java's forced indirection? What happens if you use pool := make([]Tree, 0, 256) instead of var pool []Tree in the Go so it…
Thanks for doing the test!
Do it. Show me that Java can avoid allocating/collecting the Tree objects. Go has no indirection for the Tree objects, in this example. The Trees are contiguous in memory. Measure the performance. I have no garbage…
You don't rewrite your whole program to use pooled allocations. Just the parts of your program where allocation performance needs to be improved. If part of your program is doing many allocations, and it's too slow, use…
I'm not going to paste 170 lines of code into the thread. Add this line: var pool []Tree to each of the stretch and long-lived closures in run(), pass &pool as the second argument to bottomUpTree(), pass pool as the…
Look at the Go benchmark program: https://benchmarksgame-team.pages.debian.net/benchmarksgame/... Needs to be faster? Use a pool like the C benchmark programs, but super simple: just a slice, local to the goroutine.…
How does Java do without using an array of ints, or Valhalla? In other words, what's the cost of Java's forced indirection? What happens if you use pool := make([]Tree, 0, 256) instead of var pool []Tree in the Go so it…
Thanks for doing the test!
Do it. Show me that Java can avoid allocating/collecting the Tree objects. Go has no indirection for the Tree objects, in this example. The Trees are contiguous in memory. Measure the performance. I have no garbage…
You don't rewrite your whole program to use pooled allocations. Just the parts of your program where allocation performance needs to be improved. If part of your program is doing many allocations, and it's too slow, use…
I'm not going to paste 170 lines of code into the thread. Add this line: var pool []Tree to each of the stretch and long-lived closures in run(), pass &pool as the second argument to bottomUpTree(), pass pool as the…
Look at the Go benchmark program: https://benchmarksgame-team.pages.debian.net/benchmarksgame/... Needs to be faster? Use a pool like the C benchmark programs, but super simple: just a slice, local to the goroutine.…