I have over 1000 torrents and the UI freezes for a couple seconds whenever I change the sort column/filter with lots of torrents showing.
I tried building and running the dev version to do some profiling but I don't know enough about frontend dev and even less about Svelte to figure much out.
What seems to standout is that Firefox is spending a lot of time garbage collecting (over 100ms at a time during page rebuild), so I'm guessing something is generating lots of temporary objects and it's causing GC pressure causing the freezes.
Chromium also has the same symptoms but I didn't try profiling the there.
I tried deleting the contents of the <tr> in Torrent.svelte and that mostly solves the problem, so investigation can probably focus on that part of the code. But that's probably obvious since that's what scales with the number of torrents.
Here's a tarball with 1500 torrents I generated so you can easily reproduce this: torrents.tar.gz
Note that there's no tracker configured and they're marked private so they should generate no network traffic at all.
Generated with: for ((i=0; i<1500; i++)); do echo "$i" > file && mktorrent file --private --no-date --output "$(printf '%04d' "$i")".torrent; done
Thanks for the project, I've been using it for a while and really like it but performance is unfortunately making it hard to use nowadays.
I have over 1000 torrents and the UI freezes for a couple seconds whenever I change the sort column/filter with lots of torrents showing.
I tried building and running the dev version to do some profiling but I don't know enough about frontend dev and even less about Svelte to figure much out.
What seems to standout is that Firefox is spending a lot of time garbage collecting (over 100ms at a time during page rebuild), so I'm guessing something is generating lots of temporary objects and it's causing GC pressure causing the freezes.
Chromium also has the same symptoms but I didn't try profiling the there.
I tried deleting the contents of the
<tr>
inTorrent.svelte
and that mostly solves the problem, so investigation can probably focus on that part of the code. But that's probably obvious since that's what scales with the number of torrents.Here's a tarball with 1500 torrents I generated so you can easily reproduce this: torrents.tar.gz
Note that there's no tracker configured and they're marked private so they should generate no network traffic at all. Generated with:
for ((i=0; i<1500; i++)); do echo "$i" > file && mktorrent file --private --no-date --output "$(printf '%04d' "$i")".torrent; done
Thanks for the project, I've been using it for a while and really like it but performance is unfortunately making it hard to use nowadays.