TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Go 1.9 is released

394 pointsby techietimover 7 years ago

12 comments

old-greggover 7 years ago
In case someone cares about these things, I compared the build times and the binary sizes for 1.9 vs 1.8.3 using the open source project we maintain [1]. This is on a 6-core i7-5280K:<p>Build time with 1.8.3:<p><pre><code> real 0m7.533s user 0m36.913s sys 0m2.856s </code></pre> Build time with 1.9:<p><pre><code> real 0m6.830s user 0m35.082s sys 0m2.384s </code></pre> Binary size:<p><pre><code> 1.8.3 : 19929736 bytes 1.9 : 20004424 bytes </code></pre> So... looks like the multi-threaded compilation indeed delivers better build times, but the binary size has increased slightly.<p>[1] You can git-clone and try yourself: <a href="https:&#x2F;&#x2F;github.com&#x2F;gravitational&#x2F;teleport" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;gravitational&#x2F;teleport</a>
评论 #15095558 未加载
评论 #15095961 未加载
alpbover 7 years ago
t.Helper() is certainly going to be very useful. I often implement functions like:<p><pre><code> func testServer(t *testing.T, port int) { ...do stuff... if err != nil { t.Fatalf(&quot;failed to start server: %+v&quot;, err) } } </code></pre> similarly you can have<p><pre><code> func assertMapEquals(t *testing.T, a, b map[string]int) </code></pre> It lets you hide such helper methods from the test failure&#x27;s stack trace (where t.Fatal is actually called), making test errors more readable.
评论 #15095008 未加载
zkandaover 7 years ago
In case you guys didn&#x27;t know, there&#x27;s multiple release party in different parts of the world: <a href="https:&#x2F;&#x2F;github.com&#x2F;golang&#x2F;cowg&#x2F;blob&#x2F;master&#x2F;events&#x2F;2017-08-go1.9-release-party.md" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;golang&#x2F;cowg&#x2F;blob&#x2F;master&#x2F;events&#x2F;2017-08-go...</a><p>Come join if your near the area.
评论 #15098481 未加载
tschellenbachover 7 years ago
Nice can&#x27;t wait to run some of our benchmarks against this. Go has the awesome property of always becoming a little bit faster every release. It&#x27;s like your code becomes better without doing anything. Love it :)
评论 #15095203 未加载
cristalolegover 7 years ago
Please remember that sync.Map isn&#x27;t type safe and is more optimised for reads.
评论 #15095685 未加载
评论 #15096096 未加载
评论 #15095509 未加载
Scorpiionover 7 years ago
In the release notes it says:<p><pre><code> &quot;Mutex is now more fair.&quot; </code></pre> Source: <a href="https:&#x2F;&#x2F;golang.org&#x2F;doc&#x2F;go1.9#sync" rel="nofollow">https:&#x2F;&#x2F;golang.org&#x2F;doc&#x2F;go1.9#sync</a><p>Does anyone know what that means?
评论 #15096512 未加载
评论 #15096499 未加载
tmalyover 7 years ago
I am looking forward to<p>1. runtime&#x2F;pprof package now include symbol information<p>2. Concurrent Map<p>3. Profiler Labels<p>4. database&#x2F;sql reuse of cached statements<p>5. The os package now uses the internal runtime poller for file I&#x2F;O.
评论 #15094968 未加载
e12eover 7 years ago
Does anyone know of compile-time benchmarks spanning 1.4 through 1.9, along the lines of [1]?<p>I see there&#x27;s (more) parallel compilation in 1.9 - so that should improve elapsed time (but not reduce cpu time) of compilation.<p>Would be nice to know if 1.9 is (still) on track catch up to&#x2F;pass 1.4.<p>[1] <a href="https:&#x2F;&#x2F;dave.cheney.net&#x2F;2016&#x2F;11&#x2F;19&#x2F;go-1-8-toolchain-improvements" rel="nofollow">https:&#x2F;&#x2F;dave.cheney.net&#x2F;2016&#x2F;11&#x2F;19&#x2F;go-1-8-toolchain-improvem...</a>
评论 #15095454 未加载
评论 #15094998 未加载
ivan4thover 7 years ago
I was looking forward to the fix for the dreaded Linux namespace handling problem: <a href="https:&#x2F;&#x2F;www.weave.works&#x2F;blog&#x2F;linux-namespaces-and-go-don-t-mix" rel="nofollow">https:&#x2F;&#x2F;www.weave.works&#x2F;blog&#x2F;linux-namespaces-and-go-don-t-m...</a> which kind of makes Go suck for many important container-related tasks. But apparently the effort has stalled... <a href="https:&#x2F;&#x2F;go-review.googlesource.com&#x2F;c&#x2F;go&#x2F;+&#x2F;46033" rel="nofollow">https:&#x2F;&#x2F;go-review.googlesource.com&#x2F;c&#x2F;go&#x2F;+&#x2F;46033</a>
评论 #15095080 未加载
评论 #15095288 未加载
评论 #15095085 未加载
alphaalpha101over 7 years ago
So this new concurrent map? Am I right in understanding it&#x27;s designed for cases where you have a map shared between goroutines but where each goroutine essentially owns some subset of the keys in the map?<p>So basically it&#x27;s designed for cases like &#x27;I have N goroutines and each one owns 1&#x2F;N keys&#x27;?
评论 #15094882 未加载
评论 #15094963 未加载
评论 #15094860 未加载
评论 #15095883 未加载
评论 #15094843 未加载
riobardover 7 years ago
I&#x27;m wondering if we could abuse type alias to fake generics somehow? E.g.<p><pre><code> &#x2F;&#x2F; file tree.go type T = YourConcreteType type TreeNode struct { Value T } &#x2F;&#x2F; rest of tree implementation </code></pre> Then you can just copy the file and replace YourConcreteType at the top and voila!<p>Seems simpler to use than the unicode hack here <a href="https:&#x2F;&#x2F;www.reddit.com&#x2F;r&#x2F;rust&#x2F;comments&#x2F;5penft&#x2F;parallelizing_enjarify_in_go_and_rust&#x2F;dcsgk7n&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.reddit.com&#x2F;r&#x2F;rust&#x2F;comments&#x2F;5penft&#x2F;parallelizing_...</a>
评论 #15097359 未加载
评论 #15097101 未加载
kokwakover 7 years ago
Please add enum class
评论 #15095579 未加载