heap.go performance improvement