hyperfiddle

Geoffrey Gaillard 2025-11-12T15:29:34.637739Z

Published a new Electric snapshot, corresponding to the latest pinned version: https://clojars.org/com.hyperfiddle/electric/versions/v3-alpha-00120400. This release improves overall speed and stability. Quick changelog: • Fix deadlocks caused by e/Offload • Fix IndexRing crashing on ##NaN • Fix various “diff corruption” errors • Optimize network message payload size https://docs.google.com/document/d/17BE7xpV9bFoPq9scLJHCF8hD5gBm00K0Up45N3XeG5c/edit?tab=t.0

🎉 16
2025-11-12T20:29:09.914459Z

With the new Electric Snapshot and with the October release, I have a problem with the JS heap usage increasing over time when I unmount and mount many elements over a period of time. I was hoping to revert to using the July release for the moment, until I can investigate further, but when I try that I get:

Error building classpath. Local lib com.hyperfiddle/electric-secret not found: /Users/simonkatz/.gitlibs/libs/com.hyperfiddle/electric/electric-secret

2025-11-13T21:39:07.261069Z

I’ve experimented a little, comparing v3-alpha-2025-07-11 and v3-alpha-00120400. In Chrome I’ve looked at how the JS Heap size and DOM Nodes values change when I repeatedly toggle my app’s timeline chart. I see that: • The number of DOM nodes steadily increases in both versions in much the same way. • The JS Heap size stays much the same with v3-alpha-2025-07-11, but continually increases with v3-alpha-00120400. • The v3-alpha-00120400 version responds more and more slowly the more I toggle the chart. See the table below for the numbers I collected. I see similar behaviour with toggling the app’s Table of Contents pane, which has an e/for-by very similar to the one for the chart that I linked to in my previous message. I’m happy to fiddle with my code to see if I can make anything change, but if this info sheds any light on things or if you have any suggestions for things I could try, please let me know.

|                            |                       |                              |
|----------------------------+--------------------------+---------------------------------|
| When                       |      v3-alpha-2025-07-11 |               v3-alpha-00120400 |
|                            | JS Heap size / DOM Nodes |        JS Heap size / DOM Nodes |
|----------------------------+--------------------------+---------------------------------|
| Initial load with no panes |        70 MB /        65 |               78 MB /        65 |
|                            |                          |                                 |
| After show chart           |       410 MB /       675 |              500 MB /       678 |
| After hide chart           |       410 MB /       752 |              490 MB /       755 |
|                            |                          |                                 |
| After show chart           |       422 MB /     1,293 |              700 MB /     1,257 |
| After hide chart           |       420 MB /     1,370 |              700 MB /     1,334 |
|                            |                          |                                 |
| After show chart           |       434 MB /     1,836 |              917 MB /     1,836 |
| After hide chart           |       434 MB /     1,913 |              919 MB /     1,913 |
|                            |                          |                                 |
| (5 more toggles)           |                          |                                 |
| After show chart           |       250 MB /     3,369 |            1,200 MB /     3,747 |
|                            |                          |                                 |
| (6 more toggles)           |                          |                                 |
| After show chart           |       450 MB /     7,730 |            2,700 MB /     8,000 |
| After hide chart           |                          |                                 |
|                            |                          |                                 |
| (6 more toggles)           |                          |                                 |
| After show chart           |       465 MB /    10,500 |            3,500 MB /    10,000 |
|                            |                          |                                 |
|                            |                          |    This is about half the speed |
|                            |                          |                                 |
|                            |                          | I left this for ~30 minutes and |
|                            |                          |  the numbers remained the same. |
|----------------------------+--------------------------+---------------------------------|

👀 1
2025-11-14T16:34:23.186009Z

I’ve come up with a simple example that shows the same kind of behaviour. It’s an app that repeatedly toggles the showing of many nodes. • The number of DOM nodes continually increases, with both v3-alpha-2025-07-11 and v3-alpha-00120400. • The heap size continually increases, but less fast with v3-alpha-2025-07-11 than v3-alpha-00120400. Here’s the code…

2025-11-14T16:35:24.479759Z

2025-11-14T16:39:17.313629Z

Here’s screenshot for v3-alpha-2025-07-11:

2025-11-14T16:40:15.056679Z

And a screenshot for v3-alpha-00120400:

👀 1
2026-03-27T15:05:02.158499Z

Hi. Is memory leak still a known problem? I've tried the above many-elements code with the latest release (v3-alpha-d8066cb0), and although things are better than with the November release (v3-alpha-00120400) they're still worse than with last July's release (v3-alpha-2025-07-11).

Dustin Getz (Hyperfiddle) 2026-03-27T15:08:11.230229Z

we have at least one known dom leak

👍 1
Dustin Getz (Hyperfiddle) 2026-03-27T15:25:43.895859Z

i have re-raised this issue with the team, we have been investing in test infrastructure upgrades this year

2026-03-27T15:27:18.653389Z

Great; thank you. (I’m not complaining; just wanted to be sure you still think there’s an issue.)

Dustin Getz (Hyperfiddle) 2026-03-27T15:27:54.621549Z

yes of course, all good

Dustin Getz (Hyperfiddle) 2026-03-27T15:32:49.394099Z

i can say a bit more, i think we have ~3 known electric core bugs total, but none are trivial to fix. the first was a missionary layer issue in the discrete flows, these have been rewritten and are almost delivered. The second is in the differential "incseq" layer, these are also rewritten last fall but landing them was blocked on the missionary issue. So a bunch of stuff is stacked up. The rewritten incseqs also we expect to fix the e/for performance problems or at least be the basis for the fix

🙏 3
🙏🏻 1
2025-11-12T20:29:38.761119Z

My Electric dependency is:

{:deps    {com.hyperfiddle/electric
           {:git/url ""
            :git/sha "85bbbbc2f27fe84452bbfc68db2771f3323214c3"
            :git/tag "v3-alpha-SNAPSHOT-2025-07-11"}
           ...

2025-11-12T20:29:54.668989Z

Is it possible for me to use the July version?

Geoffrey Gaillard 2025-11-12T21:12:45.234959Z

Yes, try with {:mvn/version "v3-alpha-2025-07-11"}.

Geoffrey Gaillard 2025-11-12T21:16:16.483449Z

We want to address this memory leak. Could you please tell us more? How are those many elements mounted and unmounted?

2025-11-12T21:18:35.799579Z

Thanks, that’s working. I’ll tell you more about the memory leak in a while (maybe in a few days). My time is a bit limited just at the moment.

Geoffrey Gaillard 2025-11-12T21:22:19.647989Z

Sure, np. Thank you for reporting 👍 For the records, we only identified one memory leak (detached DOM nodes still referenced) in an old demo, and this memory leak predates the current release.

👍 1
2025-11-12T21:30:45.827689Z

If you want to look at things before I get back to you… • You and Dustin have access to my repo at GitHub. • The code that mounts the elements is at https://github.com/simon-katz/nomis-timelines-ec3/blob/332e7b124c361d04fb1c67c2716f4423833c7a04/src/nomis_timelines/chart.cljc#L72-L97 But of course I don’t expect you to look at things before I look into it a bit myself. Just if you want to, you can.

👍 1
2025-11-12T21:39:12.777069Z

EDIT: Changed above link to cover more lines.