Re: [go-nuts] Re: coroutine size

2024-06-17 Thread cheng dong
simply be implements as a method > call chain without parameters in an executor. I doubt these are very > useful. > > On Jun 15, 2024, at 10:08 PM, cheng dong wrote: > > ahh, i really want to say is, can golang offer user a stateless > coroutine. > > > On Saturday

[go-nuts] Re: coroutine size

2024-06-15 Thread cheng dong
ahh, i really want to say is, can golang offer user a stateless coroutine. On Saturday, June 15, 2024 at 11:16:02 PM UTC+8 cheng dong wrote: > sorry, i found that 500k stack size might be nesessary for a coroutine, so > its not a problem. > > On Saturday, June 15, 2024 at 10:24

[go-nuts] Re: coroutine size

2024-06-15 Thread cheng dong
sorry, i found that 500k stack size might be nesessary for a coroutine, so its not a problem. On Saturday, June 15, 2024 at 10:24:18 PM UTC+8 cheng dong wrote: > maybe coroutine could be implented inside a g in future hopefully > > On Saturday, June 15, 2024 at 10:23:01 PM UTC+8 c

[go-nuts] Re: coroutine size

2024-06-15 Thread cheng dong
maybe coroutine could be implented inside a g in future hopefully On Saturday, June 15, 2024 at 10:23:01 PM UTC+8 cheng dong wrote: > thanks to runtime.newcoro/coroswitch and now we could do more things with > coroutine. but it seems every newcoro create a full g which is 448B in > si

[go-nuts] coroutine size

2024-06-15 Thread cheng dong
thanks to runtime.newcoro/coroswitch and now we could do more things with coroutine. but it seems every newcoro create a full g which is 448B in size. maybe it is too heavy for a coroutine both in size and in schedule granularity ? -- You received this message because you are subscribed to the

[go-nuts] Re: <-ctx.Done() panic

2024-01-03 Thread cheng dong
g your code under the race detector? > https://go.dev/blog/race-detector > > On Wednesday 3 January 2024 at 10:57:49 UTC cheng dong wrote: > >> i have a program paniced with >> >> ``` >> runtime.deferCallSave(0xc0313d56d8, 0xc0401839e8?) >> /home/u

[go-nuts] <-ctx.Done() panic

2024-01-03 Thread cheng dong
i have a program paniced with ``` runtime.deferCallSave(0xc0313d56d8, 0xc0401839e8?) /home/ubuntu/go/go1.19.5/src/runtime/panic.go:796 +0x88 fp=0xc0313d5618 sp=0xc0313d5608 pc=0x43b248 runtime.runOpenDeferFrame(0xc02349b860?, 0xc0300967d0) /home/ubuntu/go/go1.19.5/src/runtime/pan

[go-nuts] go 1.21 tuned gc: what's it about?

2023-06-25 Thread cheng dong
Hi there, thanks for having me here. the go 1.21rc2 release note says "there are 40% reduction in tail latency thanks to gc tuning". im very interesting in what's it about and how it improve app latency. Thanks in advance -- You received this message because you are subscribed to the Google G

Re: [go-nuts] why golang not provide likely/unlikely syntax?

2023-03-20 Thread cheng dong
pgo is great tool for optmize branch prediction, hope branch prediction feature merge into pgo as soon as possible On Tuesday, March 21, 2023 at 5:49:34 AM UTC+8 Ian Lance Taylor wrote: > On Mon, Mar 20, 2023 at 9:17 AM cheng dong wrote: > > > > i see golang source ssa gue

[go-nuts] why golang not provide likely/unlikely syntax?

2023-03-20 Thread cheng dong
i see golang source ssa guess BranchLikely/BranchUnLikely, however we could not tell golang whether if is likely or unlikely. and looks the guess logic might be far away from real condition -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To uns

[go-nuts] Re: what the asyncPreempt happens in flamegraph mean?

2023-03-14 Thread cheng dong
cal/go1.18/pkg/tool/linux_amd64" GOVCS="" GOVERSION="go1.18.1" GCCGO="gccgo" GOAMD64="v1" AR="ar" CC="gcc" CXX="g++" CGO_ENABLED="1" GOWORK="" CGO_CFLAGS="-g -O2" CGO_CPPFLAGS="" CGO_CXX

[go-nuts] Re: golang protobuf, struct copy problem

2023-01-26 Thread cheng dong
had to do is to string encode the errors and convert them back to errors on the other side. On Friday, May 8, 2020 at 2:56:22 PM UTC-4, cheng dong wrote: i use protobuf to do rpc in golang . for every message XXX in proto, i have to define a struct XXX in go, compute and then copy its field one

[go-nuts] how to handle push in http2 client?

2023-01-26 Thread cheng dong
says we do a server-push from http2 server, then how could we handle it in golang code by http client in go 1.20rc3? was there a HandlePush in early go version, if i did not forget -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe

Re: [go-nuts] could anybody tell me where to find golang implicit optimize?

2021-07-22 Thread cheng dong
thanks for reply regards cheng On Friday, July 23, 2021 at 12:44:21 PM UTC+8 Ian Lance Taylor wrote: > On Thu, Jul 22, 2021 at 6:58 PM cheng dong wrote: > > > > 1. if a function's signature is f `func([]byte)` and we have a string s, > then when we call `f([]byte(s)

[go-nuts] could anybody tell me where to find golang implicit optimize?

2021-07-22 Thread cheng dong
1. if a function's signature is f `func([]byte)` and we have a string s, then when we call `f([]byte(s))` golang wont create a []byte then copy, in opposite, golang will use the internal byte slice in string. 2. if we use a for range to set every item in slice to a const value, then the for ran

Re: [go-nuts] Re: The last line makes the variable y escape. But should it?

2021-06-01 Thread cheng dong
`y` escape because the println use interface{} as its parameter, golang can't know in compiling time what this parameter could be use (to be copy to global or send to other goroutine). so it is the interface self make golang hard to keep variable in stack On Wednesday, June 2, 2021 at 1:30:49 A

Re: [go-nuts] Re: why not support explicit delete in golang?

2021-05-28 Thread cheng dong
yes, i immediately got the point(it is far different from golang ) after i type these words. so sorry to disturb On Friday, May 28, 2021 at 3:39:25 PM UTC+8 Jesse McNelis wrote: > On Fri, May 28, 2021 at 4:51 PM cheng dong wrote: > >> Thank you for the clarification. >>

Re: [go-nuts] Re: why not support explicit delete in golang?

2021-05-27 Thread cheng dong
stack) 2. some concept like unique ptr that when it end it's life time, the object referenced can be deallocated immediately. sorry to disturb you, and thanks for answer my question On Fri, May 28, 2021 at 1:55 PM Kurtis Rader wrote: > On Thu, May 27, 2021 at 10:36 PM cheng dong wrot

Re: [go-nuts] Re: why not support explicit delete in golang?

2021-05-27 Thread cheng dong
mself (like rust lang?) Regards, cheng On Friday, May 28, 2021 at 12:00:56 PM UTC+8 Jesse McNelis wrote: > On Fri, May 28, 2021 at 12:56 PM cheng dong wrote: > >> to avoid false delete object, we could add some checking code in >> markDelete just like what we do with raceenable.

[go-nuts] Re: why not support explicit delete in golang?

2021-05-27 Thread cheng dong
to avoid false delete object, we could add some checking code in markDelete just like what we do with raceenable. one complicate case is internal pointer, we could recursively mark delete or mark delete internal pointer by hand ? On Friday, May 28, 2021 at 10:03:28 AM UTC+8 cheng dong wrote

[go-nuts] why not support explicit delete in golang?

2021-05-27 Thread cheng dong
1. first case ```go func do(x SomeInterface) {...} func outer() { var x = new(A) do(x) markDelete(x) // explicit delete x if we know x's lifetime end here } ``` if we know in advance that x's lifetime will finish when outer end. can we mark delete x. and the compiler can safely alloc x on

[go-nuts] golang protobuf, struct copy problem

2020-05-08 Thread cheng dong
i use protobuf to do rpc in golang . for every message XXX in proto, i have to define a struct XXX in go, compute and then copy its field one by one to pb.XXX(because struct XXX have some field not in pb.XXX), when i have many struct XXX, it is very ineffective and very slow. so how could i us

[go-nuts] Re: Why is there no instruction rescheduling?

2020-05-08 Thread cheng dong
i think it is because the go designer want to keep the memory order model of golang simple On Wednesday, May 6, 2020 at 11:18:28 AM UTC+8, Richard Gong wrote: > > I've been diving into golang compiler recently. As to the optimizations, I > didn't find any pass implemented instruction rescheduli