diff --git a/nimbus/db/aristo/aristo_delete.nim b/nimbus/db/aristo/aristo_delete.nim index 2c45738b0..6a59c6ba9 100644 --- a/nimbus/db/aristo/aristo_delete.nim +++ b/nimbus/db/aristo/aristo_delete.nim @@ -300,8 +300,13 @@ proc delSubTreeImpl( db.layersPutVtx(VertexID(1), wp.vid, leaf) db.layersResKey(VertexID(1), wp.vid) - # Squeze list of recycled vertex IDs - db.top.final.vGen = db.vGen.vidReorg() + # Squeeze list of recycled vertex IDs + # TODO this causes a reallocation of vGen which slows down subsequent + # additions to the list because the sequence must grow which entails a + # full copy in addition to this reorg itself - around block 2.5M this + # causes significant slowdown as the vid list is >1M entries long + # See also EIP-161 which is why there are so many deletions + # db.top.final.vGen = db.vGen.vidReorg() ok() @@ -393,8 +398,13 @@ proc deleteImpl( db.layersPutVtx(VertexID(1), wp.vid, leaf) db.layersResKey(VertexID(1), wp.vid) - # Squeze list of recycled vertex IDs - db.top.final.vGen = db.vGen.vidReorg() + # Squeeze list of recycled vertex IDs + # TODO this causes a reallocation of vGen which slows down subsequent + # additions to the list because the sequence must grow which entails a + # full copy in addition to this reorg itself - around block 2.5M this + # causes significant slowdown as the vid list is >1M entries long + # See also EIP-161 which is why there are so many deletions``` + # db.top.final.vGen = db.vGen.vidReorg() ok(emptySubTreeOk) # ------------------------------------------------------------------------------