Re: [go-nuts] Re: Why copy is much slower than append when clone a slice?

2017-06-29 Thread notcarl via golang-nuts
If Element was a pointer type, it would need to zero it first though, right? On Tuesday, June 27, 2017 at 8:11:01 PM UTC-7, Keith Randall wrote: > > This looks like it is all due to the extra zeroing required for the Copy > test. CloneWithAppend does not need to zero the newly allocated slice >

[go-nuts] Re: bit twiddling API survey

2017-01-10 Thread notcarl via golang-nuts
Are bit rotations complied to single instructions? Specifically things like: var a uint32 (a << 5) | (a >> (32 - 5) On Monday, January 9, 2017 at 3:46:45 PM UTC-8, mo...@google.com wrote: > > Hello! > > I'm working on a proposal for a compiler/hardware supported bittwidling > API. See discus

[go-nuts] Re: float32 vs float64 precision lost when casting to int

2016-12-14 Thread notcarl via golang-nuts
Is this just due to IEEE754 rounding mode? I think the spec says round to even. On Wednesday, December 14, 2016 at 9:36:23 AM UTC-8, Mauro Trajber wrote: > > The float to int conversion behaves different for 32 and 64 precision. > https://play.golang.org/p/-zkCNSTbNa > > Is this the correct beha

[go-nuts] Re: memclr optimazation does worse?

2016-12-14 Thread notcarl via golang-nuts
Be wary of slice size, as caching is going to have an extremely strong effect on the results. I submitted a CL that made append, only clear memory that was not going to be overwritten ( https://github.com/golang/go/commit/c1e267cc734135a66af8a1a5015e572cbb598d44 ). I thought this would have a

[go-nuts] Re: Best practice when creating temporary files

2016-11-21 Thread notcarl via golang-nuts
One approach that I use is to make new invocations of the program try to clean up after older ones. For example, if you name your temp directories with a particular pattern, you can delete old directories on start up. Ideally you _should_ try to clean up in the same process, but it isn't alwa