meilisearch / arroy

Spotify/Annoy-inspired Approximate Nearest Neighbors in Rust, based on LMDB and optimized for memory usage :boom:

Home Page:https://docs.rs/arroy

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Improve the deletion of `tmp_nodes`

irevoire opened this issue · comments

commented

Sometimes we need to delete new nodes previously inserted in the tmp_nodes.
From my understanding, it was always either the last one or the last last one, but it looks like it's not.

It would be good to check measure if we often do a lot of iterations, and if that's the case try to optimize it.

if let Some(el) = self.ids.iter_mut().rev().take(2).find(|i| **i == item) {