I've simple program in go, that sumarize total distance and time spend in polygon, and I'm trying to make it even faster.
https://gist.github.com/mochja/cf5f477348ab8fde1a4a
I was trying to create goroutine, first thing what i've tried was create a goroutine around pnpolys if statement, so it should create goroutine for every data in every polygon and halt, but I run into a problem with exc. time its about ~40x slower. Maybe I can't create great number of goroutines or I did miss something.
code what have tried, simple test just, why my execution time is bigger than no-goroutine version ?
for di := range d {
data := d[di]
go pnpoly(len(v[pi][0]), v[pi][0], v[pi][1], data.Longitude, data.Latitude)
}