Skip to content

Optimise I/O during indexing#702

Merged
jviotti merged 1 commit intomainfrom
less-io
Mar 4, 2026
Merged

Optimise I/O during indexing#702
jviotti merged 1 commit intomainfrom
less-io

Conversation

@jviotti
Copy link
Member

@jviotti jviotti commented Mar 4, 2026

Signed-off-by: Juan Cruz Viotti jv@jviotti.com

Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
Copy link

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 3 files

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Benchmark Index (enterprise)

Details
Benchmark suite Current: 32b41e5 Previous: 585c773 Ratio
Add one schema (0 existing) 35 ms 45 ms 0.78
Add one schema (100 existing) 315 ms 474 ms 0.66
Add one schema (1000 existing) 3060 ms 4685 ms 0.65

This comment was automatically generated by workflow using github-action-benchmark.

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Benchmark Index (community)

Details
Benchmark suite Current: 32b41e5 Previous: 585c773 Ratio
Add one schema (0 existing) 46 ms 54 ms 0.85
Add one schema (100 existing) 446 ms 473 ms 0.94
Add one schema (1000 existing) 4141 ms 4564 ms 0.91

This comment was automatically generated by workflow using github-action-benchmark.

@jviotti jviotti merged commit f68e4e2 into main Mar 4, 2026
6 checks passed
@jviotti jviotti deleted the less-io branch March 4, 2026 13:39
@augmentcode
Copy link

augmentcode bot commented Mar 4, 2026

🤖 Augment PR Summary

Summary: This PR reduces filesystem I/O overhead during indexing/build caching.

Changes:

  • Reads `.deps` files with a single buffered read + in-memory line parsing (avoids a separate `exists()` check and repeated `getline()` calls).
  • Replaces several `weakly_canonical()` calls with `lexically_normal()` when forming output/explorer paths.
Technical Notes: The new approach minimizes filesystem queries in hot paths by using purely lexical normalization instead of canonicalization.

🤖 Was this summary useful? React with 👍 or 👎

Copy link

@augmentcode augmentcode bot left a comment

Choose a reason for hiding this comment

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

Review completed. 2 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

public:
Output(std::filesystem::path path)
: path_{std::filesystem::weakly_canonical(path)} {
Output(std::filesystem::path path) : path_{path.lexically_normal()} {
Copy link

Choose a reason for hiding this comment

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

Output now stores path_ via lexically_normal() without ensuring it’s absolute; track() later walks parent_path() until it equals this->path_, which can become non-terminating at filesystem root if path_ is relative.

Severity: medium

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

return std::nullopt;
}

std::string contents{std::istreambuf_iterator<char>(stream),
Copy link

Choose a reason for hiding this comment

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

After building contents from the stream, there’s no check for read errors (e.g., badbit/failbit), so a partial read could yield an incomplete dependency list and make incremental builds incorrectly treat cached dependencies as valid.

Severity: medium

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

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.

1 participant