When inserting a new element in the heap, we don't need
When inserting a new element in the heap, we don't need

std::push_heap and a std::pop_heap

We can implement that using a single std::pop_heap.  This reduces the max number
of comparisons for each PushInternal() from

log n (for push_heap) + 2 * log n (for pop_heap) = 3 * log n

to

2 * log n (i.e., 33% reduction).  For more info, see

https://en.cppreference.com/w/cpp/algorithm/push_heap
https://en.cppreference.com/w/cpp/algorithm/pop_heap

PiperOrigin-RevId: 263805637

Intel-tensorflow/tensorflow,frreiss/tensorflow-fred,frreiss/tensorflow-fred,freedomtan/tensorflow,ppwwyyxx/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,tensorflow/tensorflow-pywrap_tf_optimizer,tensorflow/tensorflow-experimental_link_static_libraries_once,tensorflow/tensorflow,annarev/tensorflow,gunan/tensorflow,karllessard/tensorflow,tensorflow/tensorflow-pywrap_saved_model,jhseu/tensorflow,renyi533/tensorflow,annarev/tensorflow,chemelnucfin/tensorflow,yongtang/tensorflow,chemelnucfin/tensorflow,davidzchen/tensorflow,annarev/tensorflow,DavidNorman/tensorflow,gunan/tensorflow,arborh/tensorflow,petewarden/tensorflow,xzturn/tensorflow,arborh/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,freedomtan/tensorflow,petewarden/tensorflow,annarev/tensorflow,gautam1858/tensorflow,davidzchen/tensorflow,gunan/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,karllessard/tensorflow,Intel-Corporation/tensorflow,arborh/tensorflow,gautam1858/tensorflow,chemelnucfin/tensorflow,paolodedios/tensorflow,renyi533/tensorflow,xzturn/tensorflow,yongtang/tensorflow,paolodedios/tensorflow,sarvex/tensorflow,DavidNorman/tensorflow,gautam1858/tensorflow,freedomtan/tensorflow,chemelnucfin/tensorflow,cxxgtxy/tensorflow,freedomtan/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,xzturn/tensorflow,aam-at/tensorflow,jhseu/tensorflow,cxxgtxy/tensorflow,petewarden/tensorflow,adit-chandra/tensorflow,sarvex/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,Intel-tensorflow/tensorflow,freedomtan/tensorflow,DavidNorman/tensorflow,tensorflow/tensorflow,cxxgtxy/tensorflow,xzturn/tensorflow,renyi533/tensorflow,aldian/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,gunan/tensorflow,gautam1858/tensorflow,frreiss/tensorflow-fred,xzturn/tensorflow,adit-chandra/tensorflow,karllessard/tensorflow,Intel-Corporation/tensorflow,tensorflow/tensorflow-pywrap_saved_model,davidzchen/tensorflow,freedomtan/tensorflow,davidzchen/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,davidzchen/tensorflow,frreiss/tensorflow-fred,renyi533/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,ppwwyyxx/tensorflow,DavidNorman/tensorflow,paolodedios/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,petewarden/tensorflow,jhseu/tensorflow,tensorflow/tensorflow-pywrap_saved_model,davidzchen/tensorflow,karllessard/tensorflow,yongtang/tensorflow,aam-at/tensorflow,gautam1858/tensorflow,tensorflow/tensorflow-pywrap_saved_model,frreiss/tensorflow-fred,xzturn/tensorflow,arborh/tensorflow,DavidNorman/tensorflow,Intel-Corporation/tensorflow,yongtang/tensorflow,petewarden/tensorflow,freedomtan/tensorflow,DavidNorman/tensorflow,Intel-Corporation/tensorflow,chemelnucfin/tensorflow,Intel-Corporation/tensorflow,aam-at/tensorflow,ppwwyyxx/tensorflow,adit-chandra/tensorflow,ppwwyyxx/tensorflow,karllessard/tensorflow,tensorflow/tensorflow,annarev/tensorflow,arborh/tensorflow,Intel-Corporation/tensorflow,arborh/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,tensorflow/tensorflow-pywrap_saved_model,sarvex/tensorflow,renyi533/tensorflow,xzturn/tensorflow,chemelnucfin/tensorflow,gunan/tensorflow,annarev/tensorflow,jhseu/tensorflow,adit-chandra/tensorflow,arborh/tensorflow,xzturn/tensorflow,chemelnucfin/tensorflow,gautam1858/tensorflow,adit-chandra/tensorflow,tensorflow/tensorflow,DavidNorman/tensorflow,frreiss/tensorflow-fred,paolodedios/tensorflow,davidzchen/tensorflow,sarvex/tensorflow,annarev/tensorflow,gautam1858/tensorflow,xzturn/tensorflow,Intel-tensorflow/tensorflow,Intel-tensorflow/tensorflow,jhseu/tensorflow,tensorflow/tensorflow-pywrap_saved_model,DavidNorman/tensorflow,annarev/tensorflow,renyi533/tensorflow,frreiss/tensorflow-fred,freedomtan/tensorflow,paolodedios/tensorflow,annarev/tensorflow,xzturn/tensorflow,Intel-tensorflow/tensorflow,freedomtan/tensorflow,tensorflow/tensorflow,tensorflow/tensorflow-pywrap_saved_model,petewarden/tensorflow,aam-at/tensorflow,davidzchen/tensorflow,davidzchen/tensorflow,Intel-tensorflow/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,yongtang/tensorflow,DavidNorman/tensorflow,sarvex/tensorflow,jhseu/tensorflow,aldian/tensorflow,gunan/tensorflow,Intel-Corporation/tensorflow,petewarden/tensorflow,Intel-tensorflow/tensorflow,gunan/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,aldian/tensorflow,adit-chandra/tensorflow,jhseu/tensorflow,gunan/tensorflow,karllessard/tensorflow,petewarden/tensorflow,davidzchen/tensorflow,paolodedios/tensorflow,Intel-tensorflow/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,aam-at/tensorflow,tensorflow/tensorflow-pywrap_saved_model,aldian/tensorflow,gunan/tensorflow,aam-at/tensorflow,adit-chandra/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,cxxgtxy/tensorflow,freedomtan/tensorflow,tensorflow/tensorflow,ppwwyyxx/tensorflow,yongtang/tensorflow,jhseu/tensorflow,tensorflow/tensorflow,jhseu/tensorflow,tensorflow/tensorflow,arborh/tensorflow,petewarden/tensorflow,davidzchen/tensorflow,yongtang/tensorflow,chemelnucfin/tensorflow,renyi533/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,DavidNorman/tensorflow,adit-chandra/tensorflow,ppwwyyxx/tensorflow,yongtang/tensorflow,yongtang/tensorflow,petewarden/tensorflow,aam-at/tensorflow,gautam1858/tensorflow,chemelnucfin/tensorflow,jhseu/tensorflow,renyi533/tensorflow,aam-at/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,sarvex/tensorflow,jhseu/tensorflow,Intel-tensorflow/tensorflow,petewarden/tensorflow,karllessard/tensorflow,aam-at/tensorflow,cxxgtxy/tensorflow,aam-at/tensorflow,chemelnucfin/tensorflow,ppwwyyxx/tensorflow,gunan/tensorflow,yongtang/tensorflow,cxxgtxy/tensorflow,tensorflow/tensorflow,gautam1858/tensorflow,DavidNorman/tensorflow,annarev/tensorflow,paolodedios/tensorflow,adit-chandra/tensorflow,aldian/tensorflow,freedomtan/tensorflow,chemelnucfin/tensorflow,tensorflow/tensorflow-pywrap_saved_model,DavidNorman/tensorflow,karllessard/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,arborh/tensorflow,xzturn/tensorflow,yongtang/tensorflow,renyi533/tensorflow,paolodedios/tensorflow,jhseu/tensorflow,tensorflow/tensorflow-pywrap_saved_model,frreiss/tensorflow-fred,gunan/tensorflow,davidzchen/tensorflow,xzturn/tensorflow,adit-chandra/tensorflow,ppwwyyxx/tensorflow,adit-chandra/tensorflow,adit-chandra/tensorflow,cxxgtxy/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,Intel-tensorflow/tensorflow,frreiss/tensorflow-fred,renyi533/tensorflow,aam-at/tensorflow,tensorflow/tensorflow,frreiss/tensorflow-fred,ppwwyyxx/tensorflow,frreiss/tensorflow-fred,renyi533/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,petewarden/tensorflow,arborh/tensorflow,ppwwyyxx/tensorflow,Intel-tensorflow/tensorflow,arborh/tensorflow,aldian/tensorflow,karllessard/tensorflow,frreiss/tensorflow-fred,freedomtan/tensorflow,tensorflow/tensorflow,gautam1858/tensorflow,gautam1858/tensorflow,paolodedios/tensorflow,tensorflow/tensorflow-pywrap_saved_model,ppwwyyxx/tensorflow,sarvex/tensorflow,ppwwyyxx/tensorflow,Intel-Corporation/tensorflow,chemelnucfin/tensorflow,sarvex/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,gautam1858/tensorflow,arborh/tensorflow,aldian/tensorflow,karllessard/tensorflow,paolodedios/tensorflow,paolodedios/tensorflow,annarev/tensorflow,renyi533/tensorflow,aam-at/tensorflow,cxxgtxy/tensorflow,karllessard/tensorflow,aldian/tensorflow,gunan/tensorflow