Open
Description
Pressing enter a bunch of times in a large document leads to slow responses. Like, 1s + responses.
I need to know why these commits are so hard to process. They should be way faster.
I checked out the --trace chrome --log-level trace
json file in perfetto, which showed me that for every item in the set
call, atomic-server does a check_if_atom_matches_watched_query_filters
, which takes about 10 milliseconds.
There are probably a bunch of ways in which we can make this more efficient:
Do not process every atom, only those who are different
If we go from [a,b,c,d]
to [a,b,c,e]
, we could ignore [a,b,c]
. We can make a diff, and only remove d
and add e
.
Make check_if...
faster
I'm not sure how, though.