Optimization 1: Use Float32s instead of Float64s for priorities. They take just as long to generate but take less space, and may be faster to compare (though I haven't checked this.