Hello Gophers,
I just wanted to share an article and open source tool that I've
finished recently.
They both are about instrumenting (aka tracing) Go components.
Article covers some background on it, while tool helps to generate
boilerplate code to easily provide tracing hooks in your structs.
A
Hello Ian,
Thank you for your answer.
On Sun, 05/26/19, May 26, 2019 at 07:59:07PM -0400, Ian Lance Taylor wrote:
> This is not valid. The rule is that SliceHeader is only valid when
> inspecting an actual slice header. You have to write
>
> h.Data = uintptr(unsafe.Pointer(&b))
> h.Len
Hi Peter,
Thank you for your answer.
Actually it is not so – please see the rule (6) of the unsafe package
documentation:
https://golang.org/pkg/unsafe/
--
Regards,
Sergey.
On Sun, 05/26/19, May 26, 2019 at 09:43:13AM -0700, peterGo wrote:
> Sergey Kamardin,
>
> Your code is i
Hello gophers,
I have a question which relates mostly to the ideology of unsafe usage.
In `github.com/gobwas/ws` WebSocket library I used an optimization for
reading WebSocket frame headers into stack based slices (to reduce the
number of heap allocations):
func ReadHeader(r io.Reader)
Hi again,
Sorry for my previous misunderstanding. Now I realized that there no
ability in general to get the knowledge of how that slice of variadic
arguments will be used inside hidden interface method implementation.
Also, is it correct to think about variadic arguments just like about
regular
ces).
I mean, seems like that there no reason to allocate slice for passing N
arguments even for an interface method call?
Sergey.
On Mon, 11/12/18, fff Nov 12, 2018 at 10:52:07AM -0800, Ian Lance Taylor wrote:
> On Mon, Nov 12, 2018 at 4:24 AM, Sergey Kamardin wrote:
> >
> > Also,
Hello gophers,
Does Go compiler has some optimizations for function and *method* calls
with `variadic` arguments? For example, this simple benchmark:
```
package main
import "testing"
func Do(xs ...int) (s int) {
for i, x := range xs {
s += i + x
}
return
> Note that calculating the length of a slice is a fast operation; it's
> a single memory load.
So, actually it just loads a slice header's field?
On Thu, 09/06/18, fff Sep 06, 2018 at 12:56:36PM -0700, Ian Lance Taylor wrote:
> On Thu, Sep 6, 2018 at 12:24 PM, mustafa katipoğlu
> <98mustafakatip
Hi Gophers,
I have released a stable v1.0 version of https://github.com/gobwas/ws.
It implements RFC6455 and supports streaming, manual memory management and
other things for writing memory efficient WebSocket applications.
By the way it deals with highload in production servers for almost two
y
> 1. there are a lot of similar functions, for example NewBook and NewAuthor.
> The difference is type of argument passed into the function. Is it a good
> idea to combine those 2 functions with a generic New(interface{}) (string,
> error) function and reflect the actual type inside?
I would
There are methods which are using raw file descriptors (such
that https://godoc.org/github.com/mailru/easygo/netpoll#NewDesc).
суббота, 19 мая 2018 г., 2:52:27 UTC+3 пользователь Juliusz Chroboczek
написал:
>
> > You could also take a look
> > at https://godoc.org/github.com/mailru/easygo/netpo
11 matches
Mail list logo