5 ms·
That's what I was thinking. When I was learning Go years ago, I decided to go through and speed up some of the Benchmark Game's Go code. Some were on the orde
by axaxs 6y ago
That's what I was thinking.
When I was learning Go years ago, I decided to go through and speed up some of the Benchmark Game's Go code. Some were on the order of 20x speedup if I remember right.
Of course, the maintainer of the site rejected it because of what I perceive as a clear bias against the language, but the point is...it's easy to fix hotspots in Go.
- drran 6y agoMy contributions to Benchmark Game for Rust are accepted. ;-)
- gher-shyu3i 6y agoCan you link to the bitbucket pull requests?
- axaxs 6y agoWhich repo? If it has a full history, perhaps I could find it? I have a link, but it's dead now... http://benchmarksgame.alioth.debian.org/u32/program.php?test=binarytrees&lang=go&id=6 http://benchmarksgame.alioth.debian.org/u32/program.php?test... This was in 2013. My first submission was using memory pools for binary trees. It was rejected for using memory pools, even though the C version quite literally used mempool. I even redid it to use a 'third party' mempool library, rejected for the same reason. I didn't even bother submitting any others.
- igouy 6y agohttps://salsa.debian.org/benchmarksgame-team/archive-alioth-benchmarksgame/-/tree/master/contributed-source-code/benchmarksgame/binarytrees https://salsa.debian.org/benchmarksgame-team/archive-alioth-... https://blog.golang.org/ismmkeynote https://blog.golang.org/ismmkeynote
- axaxs 6y agoThanks for the links, though I'm unsure what the second link is for. I hope my assessment is 'fair.' I used to feel more strongly than I do now, I guess. It's a weird situation. The rules say 'dont write your own memory pools', but new languages wouldn't have a popular library available. Seems it should be 'dont use them at all', or allow them for all. This puts any new language at an immediate disadvantage. Anyhow, thanks for keeping it going so long. Fun little site.
- igouy 6y agoIn this case, the new language Go had GC available.
- axaxs 6y agoC has malloc and free available, even when it was new.
- igouy 6y agoNon sequitur? "Go was born out of frustration with existing languages … To meet these goals required addressing a number of linguistic issues: an expressive but lightweight type system; concurrency and garbage collection …" https://golang.org/doc/faq#creating_a_new_language https://golang.org/doc/faq#creating_a_new_language https://golang.org/doc/faq#garbage_collection https://golang.org/doc/faq#garbage_collection Seems like you wished not to show one of Go's big features?
- simpleguitar 6y agoWhy can't GC coexist with memory pools? They both have good uses. It's pretty clear that Go designers wanted a GC, but also wanted control over memory. In go, it is trivial to create a slice of structs that's contiguous in memory, and built-ins like 'copy' means the language designers wanted users to use this feature. When I write go, GC is used almost always. Except when it becomes a bottleneck, at which point I trivially switch to memory pools. I just add a comment like "preallocate to avoid allocating in a loop", and move on. The next person that comes by my code would have no trouble understanding what happened there--unlike Java where using memory pools stops looking like Java. I think when the Go FAQ mentions existing pain points, it means both GC'ed and Non-GC'ed languages. Zig is cool because it went the manual layout route, but with a pluggable allocator. I think it's a brilliant choice, especially for embedded.