Skip to content

🧹 Refactor GraphStatsCollector to improve code health#242

Open
tstapler wants to merge 1 commit into
mainfrom
refactor-graph-stats-collector-6461131231550887623
Open

🧹 Refactor GraphStatsCollector to improve code health#242
tstapler wants to merge 1 commit into
mainfrom
refactor-graph-stats-collector-6461131231550887623

Conversation

@tstapler

Copy link
Copy Markdown
Owner

🎯 What: Moved JournalEntry, pageNameFromFile, scan, connectivity, histogram, and epochDay from local functions inside collect to private members of GraphStatsCollector.
πŸ’‘ Why: Reduces the length and nesting complexity of the collect function, improving code readability and maintainability.
βœ… Verification: Verified that compilation passes and there were no syntax errors. Since no tests explicitly cover this file in jvmTest, ensured the core build works.
✨ Result: The collect function is now much cleaner, focusing only on the high-level logic, with detail implementations separated into private helper methods.


PR created automatically by Jules for task 6461131231550887623 started by @tstapler

…bers

Co-authored-by: tstapler <3860386+tstapler@users.noreply.github.com>
@google-labs-jules

Copy link
Copy Markdown
Contributor

πŸ‘‹ Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a πŸ‘€ emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@github-actions

Copy link
Copy Markdown
Contributor

Android Load Benchmark

Instrumented benchmark on an API 30 x86_64 emulator β€” 500-page synthetic graph.

Comparing decdd4ba (this PR) vs dc94048f (baseline)
Device: API 30 x86_64 emulator β€” 530 pages loaded

Graph Load

Metric This PR Baseline Delta
Phase 1 TTI ↓ 35ms 35ms 0 (0%)
Phase 3 index ↓ 3813ms 3572ms +241ms (+7%) ⚠️

Interactive Write Latency (during Phase 3)

Metric This PR Baseline Delta
Write p95 (baseline) ↓ 16ms 8ms +8ms (+100%) ⚠️
Write p95 (during phase 3) ↓ 19ms 14ms +5ms (+36%) ⚠️
Jank factor ↓ 1.19x 1.75x -0.56x (-32%) βœ…
Concurrent writes ↑ 18 18 0 (0%)

SAF I/O Overhead (ContentProvider vs direct File read)

Measures Binder IPC cost added by ContentResolver per readFile() call.
Real SAF via ExternalStorageProvider will be higher on device; this is a lower bound.

Metric This PR Baseline Delta
Direct read / file ↓ 0.0ms 0.0ms 0 (0%)
Provider read / file ↓ 0.2ms 0.2ms 0 (0%)
IPC overhead ratio ↓ 6x 6x 0 (0%)
↓ lower is better Β· ↑ higher is better

@github-actions

Copy link
Copy Markdown
Contributor

JVM Load Benchmark (Desktop)

Synthetic in-memory benchmark measuring load performance for the desktop (JVM) app.
Comparing decdd4ba (this PR) vs dc94048f (baseline)
Graph config: xlarge β€” 230 pages

Metric This PR Baseline Delta
Phase 1 TTI ↓ 7ms 1ms +6ms (+600%) ⚠️
Phase 2 background ↓ 1ms 0ms +1ms ⚠️
Phase 3 index ↓ 2ms 1ms +1ms (+100%) ⚠️
Total ↓ 10ms 2ms +8ms (+400%) ⚠️
Write p95 (baseline) ↓ 18ms 17ms +1ms (+6%) ⚠️
Write p95 (under load) ↓ 1ms n/a
Jank factor ↓ 0.06x n/a
↓ lower is better
Flamegraphs (this PR) **Allocation** β€” object allocation pressure (JDBC/SQLite churn)

Alloc flamegraph not available

CPU β€” method-level hotspots by on-CPU time

CPU flamegraph not available

Top allocation hotspots (this PR) `36.3%` byte[]_[k] `7.4%` java.lang.String_[k] `7.1%` java.util.LinkedHashMap$Entry_[k] `5.5%` int[]_[k] `3.8%` java.lang.Object[]_[k]
Top CPU hotspots (this PR) `96.9%` /usr/lib/x86_64-linux-gnu/libc.so.6 `1.1%` /tmp/sqlite-3.51.3.0-39397742-94e6-4038-8f36-7eeb6a891fbe-libsqlitejdbc.so `0.4%` __libc_pwrite `0.3%` fsync `0.2%` SR_handler

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