Inlining is conservative. As well as the size of the code being inlined,
current 40 units (unit has not scale), some operations are not inlined, as
they are considered hairy. switch used to be considered hairy, 1.7 fixed
that, for is still hairy.
On Tuesday, 30 August 2016 15:58:30 UTC+10, Soko
But still question is interesting: why decision is based on source code and not
on instructions size? Both functions likely to produce same assembler code.
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe from this group and stop r
If you can, you should reuse those slices, e.g. with sync.Pool.
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to golang-nuts+unsubscr...@googlegroups.com.
For more
Nice. Thanks!
b0 := scanner.Bytes()
b1 := make([]byte, len(b0))
copy(b1, b0)
outChannel <- b1
Chris
On Mon, Aug 29, 2016 at 8:41 PM, Caleb Spare wrote:
> You can do
>
> b0 := scanner.Bytes()
> b1 := make([]byte, len(b0))
> copy(b0, b1)
> outC
You can do
b0 := scanner.Bytes()
b1 := make([]byte, len(b0))
copy(b0, b1)
outChannel <- b0
On Mon, Aug 29, 2016 at 8:23 PM, chris.lu via golang-nuts
wrote:
> I am reading a file line by line, and send it to a chan []byte, and consume
> it on another goroutine.
>
> However, I found I must create
I am reading a file line by line, and send it to a chan []byte, and consume
it on another goroutine.
However, I found I must create a new []byte, because the scanner.Bytes()
returned a []byte slice that's shared, and the scanner may still write to
the []byte slice.
How to efficiently create a
These are the locations that are searched on *BSD machines
// Possible certificate files; stop after finding one.
var certFiles = []string{
"/usr/local/share/certs/ca-root-nss.crt", // FreeBSD/DragonFly
"/etc/ssl/cert.pem", // OpenBSD
"/etc/openssl/
Hi,
Go1.7 is faster in most benchmarks, but still slower than Java in some
benchmarks(like Go 1.6).
GO Garbage Collector needs time to become mature like JVM.
K-nucleotide, binary tree, Regex-dna are bad for GO(lack of fast GC and
good standard libraries).
But, for me, Go is an awesome substi
Well, sure. I read that too. I think it is still useful that my intuition
that Go is gaining adoption aligns with what prominent metrics are
reporting, even if it is because the reporting changed how they measured.
Eric.
On Mon, Aug 29, 2016 at 5:22 PM, Ian Lance Taylor wrote:
> On Mon, Aug 29,
Thanks Diego! I will check it out. Looks like it's what I'm after.
On Monday, August 29, 2016 at 2:07:34 PM UTC-4, Diego Medina wrote:
>
>
> Hi,
>
> You may want to look at
>
> https://golang.org/pkg/expvar/
>
> If your app is already running the built in server, you can
>
> import _ "expvar"
>
>
On Mon, Aug 29, 2016 at 4:51 PM, 'Eric Johnson' via golang-nuts
wrote:
>
> And then, for language adoption, the TIOBE language index for August of
> 2016:
> http://www.tiobe.com/tiobe-index/
>
> (Note that the above is updated every six months, and I've not been able to
> find a link to previous v
On Mon, Aug 29, 2016 at 4:21 PM, Stephen Day wrote:
> Recently, we were examining some ill-structured code that called
> (Context).Err() without first calling (Context).Done(). Typically, this
> seems to return a nil error without any guarantees as to what that means,
> but this doesn't seem to be
What version of Go are you using (go version)?
go version devel +e6f9f39 Mon Aug 29 18:25:33 2016 + linux/amd64
Checkout 1.7 from git master branch and compiled.
What operating system and processor architecture are you using (go env)?
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOS
What version of Go are you using (go version)?
go version devel +e6f9f39 Mon Aug 29 18:25:33 2016 + linux/amd64
Checkout 1.7 from git master branch and compiled.
What operating system and processor architecture are you using (go env)?
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHO
Not that I think these account for much, but sort of fun to point at:
https://benchmarksgame.alioth.debian.org/u64q/go.html
(Short summary - now with Go 1.7, Go is faster for most benchmarks.)
And then, for language adoption, the TIOBE language index for August of
2016:
http://www.tiobe.com/tiob
Recently, we were examining some ill-structured code that called
(Context).Err() without first calling (Context).Done(). Typically, this
seems to return a nil error without any guarantees as to what that means,
but this doesn't seem to be called out explicitly.
Should it be required to call Don
you can do this for the pure linux stuff:
// +build !android,linux
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to golang-nuts+unsubscr...@googlegroups.com.
For
On Mon, Aug 29, 2016 at 2:04 PM, Nate Finch wrote:
> So, just a note... the CancelFunc type doesn't prevent you from passing in
> any old func(), since those are considered effectively literals (IIRC), so
> they can be automatically converted to the CancelFunc type. For example:
> https://play.go
So, just a note... the CancelFunc type doesn't prevent you from passing in
any old func(), since those are considered effectively literals (IIRC), so
they can be automatically converted to the CancelFunc type. For
example: https://play.golang.org/p/QNbVXorlEQ
The only time the compiler will st
As per the documentation in https://golang.org/pkg/go/build/ :
Using GOOS=android matches build tags and files as for GOOS=linux in
addition to android tags and files.
So what if I want to compile a file on android but not for linux, because I
have multiple targets , one of them being linux a
Hi,
You may want to look at
https://golang.org/pkg/expvar/
If your app is already running the built in server, you can
import _ "expvar"
and then you will see a lot of internal counters at
localhost:6060/debug/vars
you can then add your own counters to it, which will also be displayed
und
On Monday, 29 August 2016 13:36:00 UTC-4, Conrad Irwin wrote:
>
> because of the automatic escape detection, I no longer think of a pointer
> as being the intrinsic address of a value; rather in my mind the & operator
> creates a new pointer value that when dereferenced returns the value.
>
>
On Mon, Aug 29, 2016 at 10:17 AM, wrote:On Friday, 26 August 2016 23:58:53 UTC-4, T L wrote:And there is also an exception for the counter rule: map elements are not addressable.Just because you can use the assignment syntax m[k]=v to update a map element does not mean a map e
On Friday, 26 August 2016 23:58:53 UTC-4, T L wrote:
>
> And there is also an exception for the counter rule: map elements are not
> addressable.
>
Just because you can use the assignment syntax m[k]=v to update a map
element does not mean a map element is a variable ("addressable"). This is
n
On Mon, Aug 29, 2016 at 8:19 AM, wrote:
>> I'm only talking about changing Darwin.
>
>
> Sorry, I meant pushing the gcc callee-saved registers in the assembly
> sigtramp functions (for example in sys_darwin_amd64.s) as it is done in
> crosscall2. I ran into the issue, that the content in the rbx
I didn't know it has more levels. thanks
On Monday, August 29, 2016 at 6:09:19 PM UTC+3, Sam Whited wrote:
>
> On Mon, Aug 29, 2016 at 9:40 AM, Ariel Mashraki
> > wrote:
> > Can someone please explain why doesn't the f2 function get inlined ?
>
> If you build with m=2 (go build -gcflags -m=2)
>
> I'm only talking about changing Darwin.
>
Sorry, I meant pushing the gcc callee-saved registers in the assembly
sigtramp functions (for example in sys_darwin_amd64.s) as it is done in
crosscall2. I ran into the issue, that the content in the rbx register was
overwritten by the sigfwdgo()
On Mon, Aug 29, 2016 at 9:40 AM, Ariel Mashraki
wrote:
> Can someone please explain why doesn't the f2 function get inlined ?
If you build with m=2 (go build -gcflags -m=2) it will spit out a reason:
> cannot inline f2: unhandled op for
(closures with "for" in them apparently can't be inlined)
Hi everyone,
today I'd like to announce (and advertise a little bit) two packages for Go
that
we've developed in our company and use them in the core of our pure-Go
backendstack.
First one, AstraNet, is a multi-purpose Go component that is a stream
multiplexer on the first place, and besides tha
On 2016-08-29 16:59, 'Chris Manghane' via golang-nuts wrote:
I can't explain exactly because my explanation is likely very flawed,
but the logic you are looking for is
in
https://github.com/golang/go/blob/320ddcf8344beb1c322f3a7f0a251eea5e442a10/src/cmd/compile/internal/gc/inl.go#L186.
Basical
I can't explain exactly because my explanation is likely very flawed, but
the logic you are looking for is in
https://github.com/golang/go/blob/320ddcf8344beb1c322f3a7f0a251eea5e442a10/src/cmd/compile/internal/gc/inl.go#L186.
Basically, labeled loops are not considered "hairy" by the compiler and c
Hello,
Running `go build -gcflags -m` on the given code below will produce:
main.go:3: can inline f1
main.go:24: inlining call to f1
Can someone please explain why doesn't the f2 function get inlined ?
Thanks
package main
func f1() int {
i := 0
loop:
if i > 10 {
On Mon, Aug 29, 2016 at 12:18 AM, wrote:
>> OK, then perhaps we need setsig in os_darwin.go to set
>> the sigaction field to a new function, written in assembler, like
>> sigtramp, but taking just the sigaction arguments.
>
>
> Could you please explain, why it is necessary to use sa_tramp with a
While doing gomobile init on OSX, I get the following error
gomobile: xcrun --show-sdk-path: exit status 1
xcrun: error: SDK "iphoneos" cannot be located
xcrun: error: SDK "iphoneos" cannot be located
xcrun: error: unable to lookup item 'Path' in SDK 'iphoneos'
Seems like xcode needs to be install
this looks great.
in my dealing with different developers from non golang community, the
package management has been a concern for them.
for me, its no too bad once you find on the many, which can be mighty
confusing for the new comer to golang.
So, i really hope this committee ends up with th
Hey everyone,
That's great news. So trying this out i got stopped...
seems i need gtk on OSX.
i got lots trying to find out how to cleanly get gtk working on OSX. Their
docs did not make sense to me.
http://www.gtk.org/download/macos.php
raised an issue.
https://github.com/TheGrum/renderview/iss
>
> OK, then perhaps we need setsig in os_darwin.go to set
> the sigaction field to a new function, written in assembler, like
> sigtramp, but taking just the sigaction arguments.
Could you please explain, why it is necessary to use sa_tramp with a custom
function instead of using the defau
37 matches
Mail list logo