make chanels buffered
parent
2b15732a5f
commit
c4fb0d8a21
|
@ -84,7 +84,7 @@ func (p *WaysCache) GetWay(id int64) (*element.Way, error) {
|
|||
}
|
||||
|
||||
func (p *WaysCache) Iter() chan *element.Way {
|
||||
way := make(chan *element.Way)
|
||||
way := make(chan *element.Way, 1024)
|
||||
go func() {
|
||||
ro := levigo.NewReadOptions()
|
||||
ro.SetFillCache(false)
|
||||
|
|
|
@ -51,10 +51,10 @@ type ErrorLevel interface {
|
|||
}
|
||||
|
||||
func parse(cache *cache.OSMCache, progress *stats.Statistics, tagmapping *mapping.Mapping, filename string) {
|
||||
nodes := make(chan []element.Node)
|
||||
coords := make(chan []element.Node)
|
||||
ways := make(chan []element.Way)
|
||||
relations := make(chan []element.Relation)
|
||||
nodes := make(chan []element.Node, 16)
|
||||
coords := make(chan []element.Node, 16)
|
||||
ways := make(chan []element.Way, 16)
|
||||
relations := make(chan []element.Relation, 16)
|
||||
|
||||
positions := parser.PBFBlockPositions(filename)
|
||||
|
||||
|
@ -71,7 +71,6 @@ func parse(cache *cache.OSMCache, progress *stats.Statistics, tagmapping *mappin
|
|||
relations,
|
||||
)
|
||||
}
|
||||
//runtime.GC()
|
||||
waitParser.Done()
|
||||
}()
|
||||
}
|
||||
|
|
|
@ -46,7 +46,7 @@ func ReadPrimitiveBlock(pos BlockPosition) *osmpbf.PrimitiveBlock {
|
|||
}
|
||||
|
||||
func (pbf *PBF) BlockPositions() (positions chan BlockPosition) {
|
||||
positions = make(chan BlockPosition)
|
||||
positions = make(chan BlockPosition, 16)
|
||||
go func() {
|
||||
for {
|
||||
offset, size := pbf.NextDataPosition()
|
||||
|
|
Loading…
Reference in New Issue