Skip to content

eliminate redundant disk reads in pagesave effects#1021

Merged
perber merged 2 commits into
mainfrom
perf/pagesave-raw-content
May 22, 2026
Merged

eliminate redundant disk reads in pagesave effects#1021
perber merged 2 commits into
mainfrom
perf/pagesave-raw-content

Conversation

@perber
Copy link
Copy Markdown
Owner

@perber perber commented May 22, 2026

No description provided.

Copilot AI review requested due to automatic review settings May 22, 2026 17:41
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 RawContent to tree.Page and populate it in TreeService.GetPage / GetPages via a new NodeStore.ReadPageAndRaw helper.
  • Update tags/properties/search side effects to use page.RawContent instead of re-reading raw content from disk.
  • Add focused tests for tags/properties side effects and for RawContent behavior (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.

Comment thread internal/core/tree/node_store.go Outdated
@perber perber merged commit ff33d4d into main May 22, 2026
6 checks passed
@perber perber deleted the perf/pagesave-raw-content branch May 22, 2026 17:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants