Live data from Hacker News

Go 1.3 beta 1 released

tip.golang.org

21–30 of 131 posts

Re: Go 1.3 beta 1 released

#21
post #20

How does performance compare to C++ for this release?

I haven't seen a direct comparison yet, but here's a bunch of benchmarks Rob Pike did comparing Go releases to Go releases:

https://groups.google.com/forum/#!topic/golang-dev/2YRmu_AWz...

If you have one version where you have a good grasp of how it compares to C++, that should provide an answer, right?

Re: Go 1.3 beta 1 released

#24

I'm excited about sync.Pool: http://tip.golang.org/pkg/sync/#Pool There are a lot of cases where people write their own version of this (myself included, but also the connections in database/sql for example). It will be great to have an implementation in the standard library. This technique has been very, very useful in StatHat's production code as we have grown.

Reading the documentation, it seems that sync.Pool will automatically shrink the pool size when it's not being used? If so, unless in the future it provides some way to specify a cleanup function for those values, using it for connections and the like would result in hanging connections (I think, not 100% sure).

Re: Go 1.3 beta 1 released

#26
post #17

I'm not asking for generics, but I really want an equivalent to Python's set data type for strings and numbers at the leas built-in. I'm aware of golang set on GitHub and the gen project as well, but I'm shocked that Go doesn't have an equivalent to the set data type yet. I'm open to suggestions.

s := make(map[string]struct{}) s["foo"] = struct{}{} if _, ok := s["foo"]; ok { // exists } There are varying amounts of fluff you can put on top of this, but that's the basic approach. Wrap it up in a type with methods if you're using it a lot in a program. Perhaps you also want built-in union, intersection, difference, etc. I personally find I need a set with simple membership testing about 10x as often as I need m…

Yes, I was actually looking for the union intersection, etc. functionality. I use that extensively in the project I work on. And it's core enough that I want it in the language, not as a third-party add on because of the performance implications and because of things the language can enforce natively. The Python set data type really is great for a certain class of problems. In particular, graph analysis and traversal.

Re: Go 1.3 beta 1 released

#28
post #2

For those wondering, os/fsnotify was pushed back to 1.4

Do you know where their current implementation of this is? I want to mess around with it and dont care if i have to change code later.

Check this out (make sure you read the README) https://github.com/howeyc/fsnotify

Re: Go 1.3 beta 1 released

#29
post #20

How does performance compare to C++ for this release?

I haven't seen a direct comparison yet, but here's a bunch of benchmarks Rob Pike did comparing Go releases to Go releases: https://groups.google.com/forum/#!topic/golang-dev/2YRmu_AWz... If you have one version where you have a good grasp of how it compares to C++, that should provide an answer, right?

thank you!

Re: Go 1.3 beta 1 released

#30

I'm very happy about the improvements to net/http.

Looks like they fixed the connection leak and you can now set real timeouts? Maybe I can finally stop using this hack:

https://github.com/pkulak/simpletransport

It sure would be nice to reuse connections without memory blowing up!

Post reply on HN