atomic-server icon indicating copy to clipboard operation
atomic-server copied to clipboard

Pushing Operations to Transaction sometimes slow

Open joepio opened this issue 4 months ago • 0 comments

While @Polleps was working on a migration to use JSON values #658, he noticed that re-builiding the index Db::build_index was very slow. 100ms per resource, where this should be at least 100x faster.

I played around a bit with his instance to find things that are slow, and it seems like the add_atom_to_prop_val_sub_index is very slow. This surprised me, since this does not even have IO, it just:

  • Creates an Operation struct. This is just a struct with two enums and a bytestring
  • Pushes that to a Vec (Transaction). A push operation is O(1), so should be instant. It doesn't apply the transaction yet.

So this should be nanosecond scale!

joepio avatar Jul 17 '25 11:07 joepio