GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||
GeezerVison is showing github.com — refactor(app): skip the eviction pass when it cannot evict by Te-River · Pull Request #54302 · anomalyco/opencode Conversation
|
|
Hey! Your PR title Please update it to start with one of:
Where See CONTRIBUTING.md for details. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
The following comment was made by an LLM, it may be inaccurate: |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
The early return is correct. It returns only when there is no overflow and no store is idle past the TTL, and in that state pickDirectoriesToEvict always returns an empty list. I checked this by reading the code. I did not measure performance: the stall in #54295 needs the desktop app on Windows with real streaming sessions. The global-sync tests show the same result as on the base (the one bootstrap.test.ts failure is a module export problem in this environment), and typecheck passes. The public API is unchanged.
Concerns:
child-store.ts and eviction.ts, and the two must stay in sync. Your own profile puts the whole pass at 0.6ms over 1,401 events, with paired runs inside the noise. If you want the shortcut, return early at the top of pickDirectoriesToEvict so the rule stays in one place. Otherwise this part can be dropped (see inline).markdown.tsx updateBlock and the solid-js/store unwrap walk). Merging with Closes #54295 would close an issue that is still open. Please change it to a plain reference, and consider opening the issue about the rendering cost that you suggested.Related: #51423
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| if (stores.length === 0) return | ||
| const now = Date.now() | ||
|
|
||
| // A store is only evictable when the count is over the cap or it has been idle |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
This adds a second copy of the overflow and idle rule from pickDirectoriesToEvict (eviction.ts), and the two now have to stay in sync. The benefit is within noise by your own measurements (0.6ms over 1,401 events). If you keep the shortcut, put it at the top of pickDirectoriesToEvict, before the filter and sort. That skips the same work without a second copy of the rule and makes the comment unnecessary. Otherwise I'd drop this part.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
All three addressed. The guard now lives in one place. It moved to the top of
The benchmark moved to #54328. This PR is now +11/−1 across two files. The profile that motivated the shortcut puts the whole pass at 0.6ms over 1401 events, so the description now says cleanup rather than fix. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
a6a01b3 to
e82301b
Compare
7321719 to
1d1a683
Compare
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
The earlier points are addressed. The shortcut now lives only in pickDirectoriesToEvict and returns early only when the existing loop would also return an empty list, so behaviour is unchanged. The PR no longer closes #54295, and the benchmark moved to #54328. The global-sync tests give the same results as on the base, and typecheck passes. The public API is unchanged. No further concerns.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
1d1a683 to
7abc837
Compare
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Earlier points are still addressed: the shortcut lives only in pickDirectoriesToEvict, and this push is just a rebase, with the change itself unchanged. I re-checked that it returns early only when the existing loop would also return an empty list, so behaviour is unchanged. The global-sync tests give the same results as on the base, and tsc -b in packages/app passes. The public API is unchanged. No further concerns.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
7abc837 to
a3e9922
Compare
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
This push is a rebase and the change itself is unchanged. The shortcut lives only in pickDirectoriesToEvict and returns early only when the existing loop would also return an empty list, so behaviour is unchanged. The global-sync tests give the same results as on the base, and tsc -b in packages/app passes. The public API is unchanged. No further concerns.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
a3e9922 to
94bf330
Compare
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
This push is a rebase and the change itself is unchanged. The shortcut lives only in pickDirectoriesToEvict and returns early only when the existing loop would also return an empty list, so behaviour is unchanged. The global-sync tests give the same results as on earlier versions, and tsc -b in packages/app passes. The public API is unchanged. No further concerns.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
runEviction runs on every event that carries a location. It walks the directory stores, filters the pinned ones (a comparablePath call each), builds a Set and sorts, even when nothing can be evicted. Skip it when the store count is at or under the cap and no store is idle past the TTL: pickDirectoriesToEvict can then only return idle directories, so the result is empty. Adds a benchmark for the parallel-session event path. A renderer profile of it puts this pass at 0.6ms over 1401 events; the dominant cost is the visible session's markdown re-render, not the fan-out.
It shows no difference for the eviction skip, and 261 lines is large for this change. Now in anomalyco#54328.
The guard was a second copy of the rule that pickDirectoriesToEvict already owns, and the two had to stay in sync. It now sits at the top of that function, using its own max/ttl/now, and child-store.ts keeps only the call. Equivalence checked with a randomized harness over 7400 store/pin/idle/skip combinations: no mismatch. The global-sync tests are 28 pass / 0 fail, the same as the stashed baseline.
94bf330 to
7ea8800
Compare
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
This push is a rebase and the change itself is unchanged. The shortcut lives only in pickDirectoriesToEvict and returns early only when the existing loop would also return an empty list, so behaviour is unchanged. The global-sync tests give the same results as on earlier versions, and tsc -b in packages/app passes. The public API is unchanged. No further concerns.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Closing to stay under this repository's open pull request limit. The branch is unchanged and can be reopened when there is room; the change and its measurement are recorded in #54295. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.