[go-nuts] Re: Go locking and channels much slower than Java equivalent, program spends most of time in sync.(*Mutex).Lock() and sync.(*Mutex).Unlock()

2016-10-04 Thread sphilippov
Try spinlocks instead of mutexes: https://github.com/pi/goal/blob/master/gut/spinlock.go -- 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...@

Re: [go-nuts] Go can't alloc custom objects from byte slice's memory address?

2016-07-10 Thread sphilippov
It is safe to assume that GC scanner will never go into maped by user regions? I.e. we can safely use mmapped pools for small objects that references only other objects from that pool? воскресенье, 10 июля 2016 г., 5:07:19 UTC+3 пользователь Ian Lance Taylor написал: > > On Fri, Jul 8, 2016 at

[go-nuts] How to allocate memory from OS in compatible way.

2016-07-11 Thread sphilippov
Hi dear gophers! I can allocated memory from OS using syscall.Mmap(-1...) on Unix and VirtualAlloc on Windows. But may be there is standard and compatible way to do this? -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this

Re: [go-nuts] How to allocate memory from OS in compatible way.

2016-07-11 Thread sphilippov
I unable to find standard mmap for windows in Go library, that was originial question. Use case is processing of large (several millions of nodes) trees. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop re

Re: [go-nuts] How to allocate memory from OS in compatible way.

2016-07-11 Thread sphilippov
Thanks for info but I'm looking for standard way (package from runtime library or from golang.org/x). I'm already have a custom VAlloc/VFree implementation for windows and unix and now curious is there a standard way that I missed. > I unable to find standard mmap for windows in Go library, tha

Re: [go-nuts] How to allocate memory from OS in compatible way.

2016-07-11 Thread sphilippov
Thank for answer but I'm already implemented portable unmanaged memory pool (https://github.com/ardente/goal/blob/master/gut/mempool.go). I'm just looking for standard direct analogue (incliding mapping of fd -1) of unix's syscall.Mmap for windows. Looks like there is none. There is some rationa

Re: [go-nuts] How to allocate memory from OS in compatible way.

2016-07-11 Thread sphilippov
Exactly. I don't know why I was misunderstood because topic title is "How to allocate memory from OS..." and in the first message I mentioned VirtualAllloc and mmap is used to obtain memory from os instead of sbrk in most unix clibs. About discussion - I think patch implementing syscall.Mmap on

[go-nuts] Re: Improvement in text/template/parse/lex.go

2016-07-11 Thread sphilippov
1ms = 100ns. According to *Many results there is no gain. понедельник, 11 июля 2016 г., 22:27:47 UTC+3 пользователь Paul Borman написал: > > I was looking at text/template/parse/lex.go and noticed it seemed to be > very inefficient in how it searched for {{ in its input. I rewrote lexText

Re: [go-nuts] How to allocate memory from OS in compatible way.

2016-07-11 Thread sphilippov
Ohh that slow gcc. Sad. понедельник, 11 июля 2016 г., 23:03:07 UTC+3 пользователь Ian Lance Taylor написал: > > On Mon, Jul 11, 2016 at 9:11 AM, > > wrote: > > Thank for answer but I'm already implemented portable unmanaged memory > pool > > (https://github.com/ardente/goal/blob/master/g

Re: [go-nuts] How to allocate memory from OS in compatible way.

2016-07-12 Thread sphilippov
GCC slow, not GC. Yes, Go's GC is quite fast and I like it alot, but there is cases where non-generational GC performs poorly, for example large nets of short living objects. I hope the new TOC will improve situation. вторник, 12 июля 2016 г., 1:52:01 UTC+3 пользователь Ian Lance Taylor написал

Re: [go-nuts] liteide x30.2 released

2016-07-12 Thread sphilippov
Thanks vfc, keep up good work! вторник, 12 июля 2016 г., 10:09:15 UTC+3 пользователь visualfc написал: > > Hi, all > > LiteIDE x30.2 released, This version bug fix and build test for Go1.7 rc1 > > > ### 2016.7.12 Ver X30.2 > * LiteApp > * add new vs-dard css, thanks [tupunco](https://github.co

[go-nuts] Re: Golang concurrency design question

2016-07-13 Thread sphilippov
Block then spawn: https://play.golang.org/p/fUZ2RKr-u0 -- 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 options,

Re: [go-nuts] Re: Golang concurrency design question

2016-07-14 Thread sphilippov
The exact context here is "concurrent directory traversal program" :) четверг, 14 июля 2016 г., 9:07:32 UTC+3 пользователь kortschak написал: > > Mostly. As always, the exact context is significant. > > On Thu, 2016-07-14 at 15:34 +0930, Dan Kortschak wrote: > > Yes. This is how it's done in the

[go-nuts] linux/amd64 1.7rc1 strange instruction sequences

2016-07-14 Thread sphilippov
go version: go1.7rc1 linux/amd64 (from go1.7rc1.linux-amd64.tar.gz ) program: https://play.golang.org/p/pUyOao-V9w pprof weblist fragment: runtime.(*mspan).sweep /usr/local/go/src/runtime/mgcsweep.go Total:10ms 110ms

[go-nuts] Re: linux/amd64 1.7rc1 strange instruction sequences

2016-07-14 Thread sphilippov
upd: windows/amd64 built from master-4054769 (latest atm), same -- 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

[go-nuts] Re: linux/amd64 1.7rc1 strange instruction sequences

2016-07-14 Thread sphilippov
It's not codegen, it's pprof's listing. Sorry for the false alarm. -- 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 m

[go-nuts] Re: Small complete examples which show the power of Go?

2016-08-10 Thread sphilippov
Easy parallelization and concurrency: package main import ( "runtime" ) func FoldParallel(data []float64, initialValue float64, op func(float64, float64) float64) float64 { sliceSize := len(data) / runtime.NumCPU() results := make(chan float64, runtime.NumCPU()) numResults :=

[go-nuts] Re: HOW CAN Golang call static library in windows

2016-08-16 Thread sphilippov
See https://blog.golang.org/c-go-cgo for info about calling C code from Go program. However, I am not sure that the cgo supports vc. 64-bit mingw-gcc from msys2 works fine. Hello everyone, > I'm a new guy in Golang. > We create a static library with VS2010, and we want go can call the > librar