Commit 3215e51
authored
perf: remove seenEvent call for cached events (#372)
* chore: bump to beta.66
* chore: bump to beta.66
* perf: remove seenEvent call for cached events
seenEvent uses an LRU cache with expiration that causes 0.24-0.64ms per
call. When loading thousands of events from cache, this adds up to
seconds of delay (e.g., 1.4s for 5700 events).
Cached events don't need seenEvent tracking because:
- seenEvent is designed to prevent duplicate processing when the same
event arrives from multiple relays during live subscriptions
- Cached events are loaded from local storage, not arriving from relays
- The performance cost far outweighs any benefit for cached data
Before: processTime ~3690ms for 5700 events
After: processTime ~22ms (162x improvement)1 parent 267ee52 commit 3215e51
File tree
27 files changed
+165
-165
lines changed- blossom
- example
- react
- svelte
- cache-browser
- cache-dexie
- cache-memory
- cache-nostr
- cache-redis
- cache-sqlite-wasm
- src/functions
- cache-sqlite
- example
- core
- messages
- mobile
- react
- example/session
- sessions
- svelte
- registry
- sync
- wallet
- examples/repl
- wot
27 files changed
+165
-165
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
13 | | - | |
14 | | - | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | | - | |
| 45 | + | |
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| |||
0 commit comments