feed: less eager rendering
#67
Merged
offbyn
merged 1 commits from feed-lazy-render
into master
1 year ago
Loading…
Reference in New Issue
There is no content yet.
Delete Branch 'feed-lazy-render'
Deleting a branch is permanent. It CANNOT be undone. Continue?
before this change every new incoming text note called a render,
that filters, sorts and iterates all known text notes and creates
missing dom elements and appends into the right place.
this change throttles and debounces (both!) the render function,
that less checks have to be performed, especially on page load
when potentially 100s of events arrive within a short time.
it is important to throttle and debounce, else either the last call
is missed or no render is called while events are being received.
this change surfaced an error in recommend server that depended on
all known text notes already being rendered and inside the dom.
this function should probably be handled by render feed itself.
tried to measure this change with lighthouse etc., but this depends on received data from relays and gave inconsistent results every time.
tired to create 100s of kind 1 event locally, but this was then the bulk of the bulk of the script. so the only way to measure this would be to have a dummy relay (maybe locally) that returns exactly the same data in same interval.
the only thing I managed to measure was that the renderFeed function is now called much less, i.e. if 100s of events are received on page load renderFeed excecutes below 10 times instead of 100s of times.
3ef066189a
tof4f951469f
1 year agof4f951469f
into master 1 year agof4f951469f
.Step 1:
From your project repository, check out a new branch and test the changes.Step 2:
Merge the changes and update on Gitea.