code: func (q *Quadtree) nextNode() *node {
  	if l := len(q.freeNodes); q.freeIndex >= l {
  		// Exponentially decrease the preallocation size.
  		// On a handful of tests, number of nodes was about 1.5 times pointers.
  		l /= 2
  
  		// min size of the preallocation. I think this could be bigger as it's
  		// not that much memory overhead. Optimizing this more would need
  		// to be use case specific.
  		if l < 25 {
  			l = 25
  		}
  
  		q.freeNodes = make([]node, l, l)
  		q.freeIndex = 0
  	}
  
  	n := &q.freeNodes[q.freeIndex]
  	q.freeIndex++
  	return n
  }
docs: // nextNode returns the next node from a preallocated list.
  // This resulted in about 15% improvement in quadtree creation.