eliminate redundant disk reads in pagesave effects#1021
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR reduces redundant page disk reads during page-save side effects by propagating raw markdown (including frontmatter) through the page model and consuming it directly in indexing effects.
Changes:
- Add
RawContenttotree.Pageand populate it inTreeService.GetPage/GetPagesvia a newNodeStore.ReadPageAndRawhelper. - Update tags/properties/search side effects to use
page.RawContentinstead of re-reading raw content from disk. - Add focused tests for tags/properties side effects and for
RawContentbehavior (including JSON exclusion).
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| internal/wiki/wiki.go | Updates orchestrator wiring for tags/properties effects after constructor signature change. |
| internal/wiki/import_adapter.go | Keeps import orchestrator wiring in sync with updated effect constructors. |
| internal/wiki/pagesave/tags_effect.go | Removes redundant raw re-read and indexes tags from Page.RawContent. |
| internal/wiki/pagesave/tags_effect_test.go | Adds coverage ensuring tags are indexed/updated/removed using raw content. |
| internal/wiki/pagesave/search_effect.go | Switches bootstrap + incremental indexing to use Page.RawContent. |
| internal/wiki/pagesave/properties_effect.go | Removes redundant raw re-read and extracts properties from Page.RawContent. |
| internal/wiki/pagesave/properties_effect_test.go | Adds coverage ensuring properties are indexed/updated/removed using raw content. |
| internal/wiki/pagesave/effects_test.go | Adds constructor tests ensuring tags/properties effects default the logger. |
| internal/core/tree/tree_service.go | Populates both stripped Content and RawContent in GetPage(s). |
| internal/core/tree/tree_service_test.go | Adds tests validating RawContent presence and JSON exclusion. |
| internal/core/tree/page.go | Extends Page with RawContent (excluded from JSON). |
| internal/core/tree/node_store.go | Introduces ReadPageAndRaw to derive stripped content from already-loaded raw content. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.