Skip to content

Index topic workflow calls for bounded reporting - #304

Merged
abhi1693 merged 11 commits into
masterfrom
fix/299-topic-report-history
Oct 24, 2026
Merged

abhi1693 merged 11 commits into
masterfrom
fix/299-topic-report-history

Conversation

@abhi1693

@abhi1693 abhi1693 commented Oct 24, 2026 •

Copy link
Copy Markdown
Owner

What changes and why?

Topic decision and inference reports expand and sort historical workflow JSON on each refresh. Project indexed, typed call facts transactionally from the existing run ledger so reporting reads matching calls without expanding historical evidence.

Each fact retains its original workflow position and lifetime stage occurrence. Completed-topic efficiency still includes the whole workflow, including calls outside the report window. Appends, settlements, corrections, removals, rollback and deletion follow the source transaction. Ongoing maintenance touches one workflow and has no global rollup or refresh job. Unchanged facts are filtered before the upsert, avoiding conflict locks on unaffected calls; a 20-call two-session regression fails with the previous trigger and passes with this fix.

The benchmark workflow updates one PR comment with separate read and write results, Before/After tables, signed cost deltas and improvement percentages. Positive improvement means reduced cost; negative means increased cost. Read gains do not imply an overall performance win. Separate committed-write comparisons cover append, settlement, correction and checkpoint transactions at both 5 and 20 lifetime calls. General profiling supports PostgreSQL 17+; the production comparison independently requires PostgreSQL 17. Disposable database credentials are generated at runtime, and profiling creates new JSON artifacts within reports/ without following symlinks or overwriting existing files.

Related issues

Closes #299.

Validation

  • 24 reporting tests passed on PostgreSQL 17, covering exact released-SQL/output comparisons, repeated/missing stages, malformed usage, partial/failed/completed workflows, inclusive UTC boundaries, concurrent updates, idempotency, deletion/truncate, rollback, backfill and downgrade/re-upgrade.
  • Actual PostgreSQL plans verify indexed date-range reads without historical JSON expansion, stage sorting or temporary writes.
  • Migration concurrency tests cover writers before/after a flush and report readers holding fact-table locks, for both upgrade and downgrade. An actual 0036 → 0035 → head round trip verifies that topic source history and rebuilt facts survive while the scheduler triggers and clock-only projection updates remain active.
  • 67 profiler tests passed on real PostgreSQL 17, verifying safe database selection, output containment and file-creation races, unchanged source fixtures, trigger restoration after failure, cross-window retries and WAL measurements including AFTER-trigger work. Independent connections verify lifecycle commits at 5 and 20 calls; complete cleanup and recovery after a partial commit are covered.
  • The previously failing CI shard passes on PostgreSQL 18: 479 tests, zero failures or skips (bash scripts/ci/python-tests.sh integration 1 6).
  • Python lint, formatting, types, versions and pre-commit pass. All 36 automatic-comment regression tests pass, including mixed read/write outcomes and updating the same existing comment across reruns. Final-head hosted CI passes on ae25dc11, including all six integration shards, every browser variant, CodeQL, SonarQube, all 12 ARM64 image build/scan/smoke jobs and CI required. SonarQube reports zero new issues and 95.8% new-code coverage. All native profile workflows pass their checks; the topic report independently discloses higher committed-write latency rather than claiming an overall performance win.
  • Backend-only change; no visible UI changes.

Native ARM64 volume results

Mixed performance: topic reads improve; committed writes cost more. These are final-head ae25dc11 measurements from native ARM64 PostgreSQL 17.11 with work_mem=4MB. The existing results comment updates in place and explicitly states read IMPROVED / write HIGHER LATENCY OBSERVED.

Delta = after − before. Improvement = (before − after) / before; positive means reduced cost.

Report pair median Before After Delta Improvement
100,000 articles 418.308 ms 53.690 ms -364.618 ms +87.2%
300,000 articles 1,348.465 ms 129.388 ms -1,219.077 ms +90.4%

At 100k / 300k articles, fixtures contain 6k / 18k decision workflows, 18k / 54k calls and 500k / 1.5m inference rows. The read-only production reference had 92,581 articles, 5,000 workflows and 14,373 calls. Complete report JSON matched the previous implementation for 1/7/30/90-day windows at both sizes. Topic SQL replay was 12.0× / 23.6× faster and temporary writes fell from 55.69 MiB to zero.

Committed lifecycle costs at 300k articles and the 20-call lifetime limit:

Operation Before After Delta Improvement
Append + article insert median 2.908 ms 3.504 ms +0.596 ms -20.5%
Settlement median 1.397 ms 1.913 ms +0.516 ms -36.9%
Correction median 1.387 ms 1.890 ms +0.503 ms -36.3%
Checkpoint median 1.375 ms 1.437 ms +0.062 ms -4.5%
All-operation p95 3.049 ms 3.650 ms +0.601 ms -19.7%
Lifecycle phase wall time 4.342 s 5.359 s +1.017 s -23.4%
Application thread CPU 1.120 s 1.174 s +0.053 s -4.8%

Each 5- and 20-call cohort has 2,400 real commits per strategy across three alternating-order pairs. Latency includes COMMIT; final source states match and current facts are verified. The readable comment includes both dataset sizes and both lifetime limits, including negative improvements. The original rollback diagnostics remain separate.

WAL is server-wide and samples have unequal full-page images; no stable write-amplification percentage is established. Setup/cleanup is excluded and physical heap/index bloat is not restored between phases. These fixed lifecycle samples do not establish full ingestion capacity, sustained vacuum behavior or a net production performance win. No universal writer-latency budget has been defined.

Read diagnostics use four concurrent report workers, 12 report pairs and 200 paced rollback-only writer transactions. Writer-phase overlap includes pacing sleeps and does not prove continuous SQL overlap. Application process CPU for that phase changed 0.458 → 0.407 s / 0.505 → 0.466 s; this is not database CPU. Equivalent backfill took 0.412 / 1.295 seconds, excluding migration DDL and lock admission.

The separate public reader API comparison remains inconclusive; its passing CI threshold does not establish an improvement.

Rollout notes

Migration 0036 follows the scheduler migration 0035 from the current base. Backfill and trigger installation are atomic. Upgrade admission excludes existing run row lockers and releases partial table locks before retrying, failing cleanly after 30 seconds of sustained contention. Once admitted, proposal/run writes pause through the one-time backfill/index creation; ordinary reads continue.

Rollback application code and schema together. Downgrade uses bounded admission for all affected tables, draining writers and readers before its exclusive DDL locks. Downgrading to 0035 removes topic-derived facts/indexes/functions while preserving authoritative source JSON for rebuilding and retaining the scheduler clock capture.

Deployment is outside this task. After release, compare fresh query-statistics deltas under matched workloads and verify report freshness, worker latency, write amplification and correction/deletion recovery. See the benchmark and rollout guide.

Ready for review

  • The description explains the change and validation results, including gaps.
  • Relevant documentation and regression tests are updated.

@github-actions

github-actions Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

Backend unit coverage

PASS · minimum combined coverage 98.00%.

Tests: 10792 passed, 0 failed, 0 skipped. Source files: 367.

Workspace Lines Branches Combined
All backend code 98.68% 95.66% 98.01%
apps/admin-api 96.66% 89.65% 95.33%
apps/aggregator 97.99% 94.45% 97.18%
apps/api 99.50% 98.89% 99.39%
apps/article-enrichment-worker 80.00% 50.00% 71.43%
apps/cli 99.43% 90.76% 98.13%
apps/images-worker 80.00% 50.00% 71.43%
apps/mcp 99.86% 98.70% 99.65%
apps/notifications 100.00% 100.00% 100.00%
apps/partner-api 99.47% 95.51% 98.83%
apps/search-indexer 85.48% 85.71% 85.53%
apps/source-discovery-worker 80.00% 50.00% 71.43%
apps/user-api 99.88% 98.96% 99.72%
packages/core 99.11% 96.86% 98.55%
packages/http 99.47% 97.49% 99.03%

Unit coverage includes every backend workspace. PostgreSQL/Redis integration tests run separately.

Commit: ae25dc1 · HTML, JSON, XML reports and job logs · attempt 1

@github-actions

github-actions Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

PR performance results

Current PR head: ae25dc11cc1b2769cd32b347585eef9207104436

Token usage benchmark

Pending: no results have been published.

Reader API performance

Source head: ae25dc11cc1b2769cd32b347585eef9207104436 · run 40134661675 · attempt 1

PR reader API performance

Result: INCONCLUSIVE

7 inconclusive · 1 within threshold. Zero request failures across all six runs.

Base 5a566acd4148334c97d132ea5421c53a2118e886 → PR ae25dc11cc1b2769cd32b347585eef9207104436

Three independent GitHub-hosted ARM64 runners, each measuring base and PR sequentially with alternating order and isolated resources for every sample. 16 users, completed bootstrap and 15 seconds of warmup before each full 60-second measurement, fixed journey seed 294, 1,000 synthetic articles, cache off, five PgBouncer slots.

Latency comparison

All latency values are in milliseconds; lower is better. Values are medians of three runs, with one-millisecond histogram bins.

Route Base p95 PR p95 Change Result
All requests 102 80 -22 (-21.6%) Inconclusive
Latest feed 125 103 -22 (-17.6%) Inconclusive
Feed pagination 102 75 -27 (-26.5%) Inconclusive
Article detail 70 58 -12 (-17.1%) Inconclusive
Source feed 99 95 -4 (-4.0%) Inconclusive
Topic feed 89 65 -24 (-27.0%) Inconclusive
Feed filters 99 75 -24 (-24.2%) Inconclusive
Sources 46 39 -7 (-15.2%) Within threshold
Topics 53 36 -17 (-32.1%) Inconclusive
Additional latency and throughput metrics

Each cell shows base → PR. Latencies are in milliseconds.

Endpoint p50 p99 Requests/s
Aggregated 34 → 30 142 → 123 28.68 → 29.10
/v1/feed [latest] 48 → 43 154 → 139 8.62 → 8.71
/v1/feed [page] 33 → 29 140 → 118 4.07 → 4.11
/v1/articles/[id] 22 → 19 126 → 105 5.82 → 5.91
/v1/feed [source] 34 → 29 144 → 131 2.02 → 2.05
/v1/feed [topic] 31 → 30 155 → 133 1.60 → 1.62
/v1/feed/options 24 → 22 129 → 110 2.18 → 2.23
/v1/sources 14 → 12 92 → 92 2.18 → 2.23
/v1/topics 16 → 13 96 → 52 2.18 → 2.23
All paired p95 samples and changes

Each pair shares a validated runner. Cells show base → PR p95 (absolute and percentage change), in milliseconds. Slower/faster counts use the same strict 20% and 20 ms thresholds against that pair's own baseline.

Route Pair 1 Pair 2 Pair 3 Slower pairs Faster pairs
All requests 114 → 119 (+5, +4.4%) 102 → 80 (-22, -21.6%) 87 → 74 (-13, -14.9%) 0 1
Latest feed 132 → 146 (+14, +10.6%) 125 → 103 (-22, -17.6%) 118 → 102 (-16, -13.6%) 0 0
Feed pagination 115 → 122 (+7, +6.1%) 102 → 75 (-27, -26.5%) 81 → 57 (-24, -29.6%) 0 2
Article detail 70 → 90 (+20, +28.6%) 83 → 58 (-25, -30.1%) 62 → 58 (-4, -6.5%) 0 1
Source feed 118 → 95 (-23, -19.5%) 99 → 96 (-3, -3.0%) 84 → 62 (-22, -26.2%) 0 1
Topic feed 156 → 106 (-50, -32.1%) 89 → 65 (-24, -27.0%) 67 → 55 (-12, -17.9%) 0 2
Feed filters 99 → 96 (-3, -3.0%) 101 → 75 (-26, -25.7%) 75 → 49 (-26, -34.7%) 0 2
Sources 46 → 49 (+3, +6.5%) 48 → 39 (-9, -18.8%) 37 → 34 (-3, -8.1%) 0 0
Topics 53 → 51 (-2, -3.8%) 55 → 36 (-19, -34.5%) 30 → 31 (+1, +3.3%) 0 0
Individual runs
Run Requests Failures Exit code
Base 1 1715 0 0
Base 2 1720 0 0
Base 3 1742 0 0
PR 1 1717 0 0
PR 2 1747 0 0
PR 3 1755 0 0
How to interpret this report

Regressed / Improved: a p95 regression needs >20% and >20 ms increase in the medians and in at least two same-runner base/PR pairs. Improvements use the inverse threshold. Within threshold means the change did not meet both thresholds.

Inconclusive: a within-revision p95 range >35% of its median and >20 ms is too noisy for a confident latency verdict. A material median change without two confirming pairs is also inconclusive; this does not prove unchanged performance.

Inconclusive latency comparisons are non-blocking: the check passes without claiming an improvement. Confirmed regressions and test/report errors fail the PR gate. Throughput is descriptive: paced users do not measure maximum capacity. This uncached public API test does not establish production health, browser performance or worker capacity. Base and PR share a runner within each pair; three pairs use independent runners. Alternating order reduces host-assignment bias but cannot eliminate changes in host load over time.

Full HTML/CSV reports and logs · attempt 1

@github-actions

github-actions Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

Topic report history

Read result: IMPROVED. Write result: HIGHER LATENCY OBSERVED.

Native ARM64 PostgreSQL 17 · 90-day concurrent reports.

Delta = after - before. Improvement = (before - after) / before × 100: positive means less time/work; negative means slower or higher cost.

Tested commit: ae25dc11cc1b2769cd32b347585eef9207104436 · Workflow, artifacts and full plans · attempt 1.

100,000 articles

PostgreSQL 17.11 / ARM64 / work_mem 4MB. 6,000 workflows · 18,000 topic calls · 500,000 inference rows.

Metric Before After Delta (after - before) Improvement
Report pair median 418.308 ms 53.690 ms -364.618 ms +87.2%
Topic SQL replay total 4,020.763 ms 335.166 ms -3,685.597 ms +91.7%
Topic SQL replay temp writes 55.688 MiB 0.000 MiB -55.688 MiB +100.0%
Application CPU 0.458 s 0.407 s -0.051 s +11.1%
Rolled-back synthetic write median 3.709 ms 4.028 ms 🔺 +0.319 ms -8.6%
Rolled-back synthetic write p95 7.021 ms 4.556 ms -2.465 ms +35.1%
Rolled-back correction 0.502 ms 0.974 ms 🔺 +0.472 ms -94.0%
WAL snapshot (FPI-sensitive) 23.227 KiB 30.250 KiB 🔺 +7.023 KiB -30.2%

Exact output parity: 1 / 7 / 30 / 90 days passed. Observed checks: 4/4. 4 report workers; 12 report pairs total; 200 ingestion transactions per strategy. Equivalent backfill: 0.412 s. Correction full-page images: 0 → 1.

The synthetic writes and correction above roll back and exclude commit latency; they cannot establish durable write throughput or overall production benefit.

Write result: HIGHER LATENCY OBSERVED. Committed topic operations follow.

Committed topic writes: 5 calls per workflow

3 alternating repeats; 600 iterations and 2,400 committed transactions per strategy. Source histories match and normalized facts were verified.

Metric Before After Delta (after - before) Improvement
Append median (commit included) 2.766 ms 3.169 ms 🔺 +0.403 ms -14.6%
Settle median (commit included) 1.325 ms 1.718 ms 🔺 +0.393 ms -29.7%
Correction median (commit included) 1.309 ms 1.712 ms 🔺 +0.403 ms -30.8%
Checkpoint median (commit included) 1.309 ms 1.332 ms 🔺 +0.023 ms -1.8%
All committed operations p95 2.916 ms 3.362 ms 🔺 +0.446 ms -15.3%
Committed lifecycle phase 4.552 s 5.062 s 🔺 +0.510 s -11.2%
Application thread CPU 1.169 s 1.176 s 🔺 +0.007 s -0.6%
Committed writes WAL snapshot 60,373.328 KiB 60,073.867 KiB -299.461 KiB +0.5%

WAL full-page images: 609 → 808. WAL is a server-wide snapshot sensitive to full-page images and background activity; it is not a stable amplification ratio.

Committed topic writes: 20 calls per workflow

3 alternating repeats; 600 iterations and 2,400 committed transactions per strategy. Source histories match and normalized facts were verified.

Metric Before After Delta (after - before) Improvement
Append median (commit included) 2.850 ms 3.325 ms 🔺 +0.475 ms -16.7%
Settle median (commit included) 1.389 ms 1.876 ms 🔺 +0.487 ms -35.1%
Correction median (commit included) 1.367 ms 1.851 ms 🔺 +0.484 ms -35.4%
Checkpoint median (commit included) 1.364 ms 1.413 ms 🔺 +0.049 ms -3.6%
All committed operations p95 3.020 ms 3.482 ms 🔺 +0.462 ms -15.3%
Committed lifecycle phase 5.218 s 6.329 s 🔺 +1.111 s -21.3%
Application thread CPU 1.148 s 1.141 s -0.007 s +0.6%
Committed writes WAL snapshot 64,429.117 KiB 64,691.961 KiB 🔺 +262.844 KiB -0.4%

WAL full-page images: 129 → 91. WAL is a server-wide snapshot sensitive to full-page images and background activity; it is not a stable amplification ratio.

300,000 articles

PostgreSQL 17.11 / ARM64 / work_mem 4MB. 18,000 workflows · 54,000 topic calls · 1,500,000 inference rows.

Metric Before After Delta (after - before) Improvement
Report pair median 1,348.465 ms 129.388 ms -1,219.077 ms +90.4%
Topic SQL replay total 15,788.191 ms 669.396 ms -15,118.795 ms +95.8%
Topic SQL replay temp writes 55.688 MiB 0.000 MiB -55.688 MiB +100.0%
Application CPU 0.505 s 0.466 s -0.039 s +7.7%
Rolled-back synthetic write median 3.923 ms 4.420 ms 🔺 +0.497 ms -12.7%
Rolled-back synthetic write p95 7.150 ms 5.038 ms -2.112 ms +29.5%
Rolled-back correction 0.579 ms 1.039 ms 🔺 +0.460 ms -79.4%
WAL snapshot (FPI-sensitive) 29.852 KiB 23.625 KiB -6.227 KiB +20.9%

Exact output parity: 1 / 7 / 30 / 90 days passed. Observed checks: 4/4. 4 report workers; 12 report pairs total; 200 ingestion transactions per strategy. Equivalent backfill: 1.295 s. Correction full-page images: 1 → 0.

The synthetic writes and correction above roll back and exclude commit latency; they cannot establish durable write throughput or overall production benefit.

Write result: HIGHER LATENCY OBSERVED. Committed topic operations follow.

Committed topic writes: 5 calls per workflow

3 alternating repeats; 600 iterations and 2,400 committed transactions per strategy. Source histories match and normalized facts were verified.

Metric Before After Delta (after - before) Improvement
Append median (commit included) 2.888 ms 3.307 ms 🔺 +0.419 ms -14.5%
Settle median (commit included) 1.334 ms 1.744 ms 🔺 +0.410 ms -30.7%
Correction median (commit included) 1.316 ms 1.731 ms 🔺 +0.415 ms -31.5%
Checkpoint median (commit included) 1.310 ms 1.356 ms 🔺 +0.046 ms -3.5%
All committed operations p95 3.064 ms 3.447 ms 🔺 +0.383 ms -12.5%
Committed lifecycle phase 4.570 s 4.992 s 🔺 +0.422 s -9.2%
Application thread CPU 1.146 s 1.158 s 🔺 +0.012 s -1.1%
Committed writes WAL snapshot 68,482.547 KiB 66,509.852 KiB -1,972.695 KiB +2.9%

WAL full-page images: 2,021 → 1,647. WAL is a server-wide snapshot sensitive to full-page images and background activity; it is not a stable amplification ratio.

Committed topic writes: 20 calls per workflow

3 alternating repeats; 600 iterations and 2,400 committed transactions per strategy. Source histories match and normalized facts were verified.

Metric Before After Delta (after - before) Improvement
Append median (commit included) 2.908 ms 3.504 ms 🔺 +0.596 ms -20.5%
Settle median (commit included) 1.397 ms 1.913 ms 🔺 +0.516 ms -36.9%
Correction median (commit included) 1.387 ms 1.890 ms 🔺 +0.503 ms -36.3%
Checkpoint median (commit included) 1.375 ms 1.437 ms 🔺 +0.062 ms -4.5%
All committed operations p95 3.049 ms 3.650 ms 🔺 +0.601 ms -19.7%
Committed lifecycle phase 4.342 s 5.359 s 🔺 +1.017 s -23.4%
Application thread CPU 1.120 s 1.174 s 🔺 +0.053 s -4.8%
Committed writes WAL snapshot 67,901.211 KiB 68,202.344 KiB 🔺 +301.133 KiB -0.4%

WAL full-page images: 752 → 723. WAL is a server-wide snapshot sensitive to full-page images and background activity; it is not a stable amplification ratio.

Before = PR base; after = tested commit. 🔺 marks increased cost. Concurrent report diagnostics use paced writers and roll back; that phase includes SQL and sleeps, not continuous SQL overlap or durable-commit throughput. Committed lifecycle samples include COMMIT; phase elapsed time and application thread CPU compare fixed logical work, not pipeline capacity. Concurrent diagnostic CPU is application process CPU. Statement WAL uses a server-wide LSN delta including AFTER triggers/background activity; unequal full-page images prevent a stable WAL-amplification estimate. Topic SQL replay totals come from separate EXPLAIN executions after each timed report. Backfill excludes migration DDL and lock waits. Committed topic measurements include commit latency; they do not measure full ingestion-pipeline capacity or establish an overall production benefit.

Comment thread scripts/ci/topic-report-comment.test.mjs Fixed
Comment thread .github/workflows/topic-report-profile.yml Fixed
Comment thread .github/workflows/topic-report-profile.yml Fixed
Comment thread scripts/profile_topic_reports.py Fixed
Comment thread .github/workflows/topic-report-profile.yml Fixed
@github-actions

github-actions Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

Feed-options scale comparison

COMPLETE · measurement job: success.

Baseline: 5a566acd4148 · Candidate: ae25dc11cc1b

Full SQL plans, timing samples and job logs · attempt 1

Feed options benchmark: COMPLETE

50/50 scenarios returned identical public JSON; 250 timed before/after pairs.
Native architecture: aarch64; PostgreSQL 17.11 (Debian 17.11-1.pgdg13+2). Before 5a566acd → after ae25dc11.

Improvement = (before − after) / before × 100. + means less time/work; − means more.

Default English: full options call

Workload Before After Improvement
2,000 / English, idle 28.73 ms 28.27 ms +1.6%
100,000 / English, idle 30.71 ms 30.60 ms +0.4%
1,000,000 / English, idle 55.50 ms 54.65 ms +1.5%
1,000,000 / English, ingestion 55.05 ms 55.26 ms -0.4%

Source work at 1,000,000 articles, default English

Metric Before After Improvement
Source SQL replay 30.64 ms 30.60 ms +0.1%
Origin lookups 500 500 +0.0%
Article lookups 661 661 +0.0%
Buffer hits 9,162 9,162 +0.0%
Temporary blocks written 0 0 0.0%
Request CPU 23.10 ms 22.06 ms +4.5%

Concurrent ingestion at 1,000,000 articles: 20,380 additional articles committed; 0 errors.

All 50 route scenarios: before, after and signed improvement
Workload Before After Improvement
2,000 / English, idle 28.73 ms 28.27 ms +1.6%
2,000 / All languages, idle 27.31 ms 27.54 ms -0.8%
2,000 / Rare language, idle 14.01 ms 14.17 ms -1.1%
2,000 / Absent language, idle 13.44 ms 13.36 ms +0.6%
2,000 / Minority content type, idle 17.84 ms 18.10 ms -1.5%
2,000 / Topic + tag, idle 5.97 ms 6.18 ms -3.5%
2,000 / Search, idle 4.57 ms 4.56 ms +0.2%
2,000 / English, ingestion 29.07 ms 29.04 ms +0.1%
2,000 / All languages, ingestion 29.92 ms 29.79 ms +0.4%
2,000 / Rare language, ingestion 14.85 ms 14.80 ms +0.3%
2,000 / Absent language, ingestion 14.78 ms 14.76 ms +0.1%
2,000 / Minority content type, ingestion 20.33 ms 19.05 ms +6.3%
2,000 / Topic + tag, ingestion 6.19 ms 6.02 ms +2.8%
2,000 / Search, ingestion 4.96 ms 5.34 ms -7.7%
100,000 / English, idle 30.71 ms 30.60 ms +0.4%
100,000 / All languages, idle 30.00 ms 30.13 ms -0.4%
100,000 / Rare language, idle 206.14 ms 203.01 ms +1.5%
100,000 / Absent language, idle 348.84 ms 343.40 ms +1.6%
100,000 / Minority content type, idle 47.40 ms 47.25 ms +0.3%
100,000 / Topic + tag, idle 127.46 ms 125.66 ms +1.4%
100,000 / Search, idle 21.16 ms 21.56 ms -1.9%
100,000 / English, generic plan, idle 34.21 ms 34.08 ms +0.4%
100,000 / Rare language, generic plan, idle 233.23 ms 225.22 ms +3.4%
100,000 / English, ingestion 31.23 ms 32.72 ms -4.8%
100,000 / All languages, ingestion 30.48 ms 30.41 ms +0.2%
100,000 / Rare language, ingestion 228.88 ms 227.11 ms +0.8%
100,000 / Absent language, ingestion 368.81 ms 374.92 ms -1.7%
100,000 / Minority content type, ingestion 65.59 ms 62.73 ms +4.4%
100,000 / Topic + tag, ingestion 36.31 ms 36.26 ms +0.1%
100,000 / Search, ingestion 19.21 ms 19.35 ms -0.7%
100,000 / English, generic plan, ingestion 36.34 ms 35.13 ms +3.3%
100,000 / Rare language, generic plan, ingestion 236.67 ms 230.56 ms +2.6%
1,000,000 / English, idle 55.50 ms 54.65 ms +1.5%
1,000,000 / All languages, idle 54.00 ms 54.72 ms -1.3%
1,000,000 / Rare language, idle 332.01 ms 328.20 ms +1.1%
1,000,000 / Absent language, idle 5,875.70 ms 5,780.77 ms +1.6%
1,000,000 / Minority content type, idle 155.90 ms 157.22 ms -0.8%
1,000,000 / Topic + tag, idle 1,685.64 ms 1,710.00 ms -1.4%
1,000,000 / Search, idle 79.66 ms 78.75 ms +1.2%
1,000,000 / English, generic plan, idle 161.51 ms 159.80 ms +1.1%
1,000,000 / Rare language, generic plan, idle 480.12 ms 476.17 ms +0.8%
1,000,000 / English, ingestion 55.05 ms 55.26 ms -0.4%
1,000,000 / All languages, ingestion 54.92 ms 54.85 ms +0.1%
1,000,000 / Rare language, ingestion 384.09 ms 388.82 ms -1.2%
1,000,000 / Absent language, ingestion 6,088.85 ms 5,972.76 ms +1.9%
1,000,000 / Minority content type, ingestion 160.25 ms 158.53 ms +1.1%
1,000,000 / Topic + tag, ingestion 515.78 ms 516.45 ms -0.1%
1,000,000 / Search, ingestion 76.98 ms 77.47 ms -0.6%
1,000,000 / English, generic plan, ingestion 161.54 ms 163.05 ms -0.9%
1,000,000 / Rare language, generic plan, ingestion 472.13 ms 475.26 ms -0.7%

Warmed query medians include SQL, ORM hydration, validation and JSON serialization. Each pair shares a read-only snapshot; order alternates. Source SQL metrics come from later EXPLAIN replay with supplied binds, separately from route timings and the exact prepared plans. This is synthetic evidence, not production HTTP p95.

Unchanged content-type probes can still dominate absent-language requests; no speedup is claimed for every filter. Historical fixture loading bypasses USER triggers with FKs/indexes retained; measured ingestion runs migrated triggers. Shared ingestion measures contention, not before/after write amplification or capacity.

@github-actions

github-actions Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

Scheduler recheck scale results

PASS · native ARM64 · PostgreSQL 17.11 · 5 × 50 rechecks + 50 concurrent ingests per dataset.

Improvement: positive = less work or time; negative = regression. Before and after use identical historical populations.

100,000 articles

Valid controlled comparison: native ARM64, PostgreSQL 17, matched dataset and workload.

Metric Before After Delta Improvement (+/-)
Workload runtime (s) 16.303 15.037 -1.266 +7.8%
Application CPU (s) 14.337 13.244 -1.093 +7.6%
Clock-only events 0 0 0 0.0%
Cohort card hydrations 0 0 0 0.0%
SQL calls 5,635 5,636 +1 -0.0%
Shared blocks hit 483,527 491,950 +8,423 -1.7%
Shared blocks read 3,671 620 -3,051 +83.1%
Temporary blocks written 0 0 0 0.0%
WAL records 8,435 8,440 +5 -0.1%
WAL full-page images 846 893 +47 -5.6%
WAL bytes 6,462,907 6,791,751 +328,844 -5.1%

Positive improvement means reduced cost; negative means increased cost. Delta = after - before.

Base 5a566acd4148334c97d132ea5421c53a2118e886 → candidate ae25dc11cc1b2769cd32b347585eef9207104436.
Workflow run.

150,000 articles

Valid controlled comparison: native ARM64, PostgreSQL 17, matched dataset and workload.

Metric Before After Delta Improvement (+/-)
Workload runtime (s) 21.702 18.534 -3.168 +14.6%
Application CPU (s) 19.800 16.705 -3.095 +15.6%
Clock-only events 0 0 0 0.0%
Cohort card hydrations 0 0 0 0.0%
SQL calls 5,636 5,636 0 0.0%
Shared blocks hit 689,478 691,339 +1,861 -0.3%
Shared blocks read 6,681 9,103 +2,422 -36.3%
Temporary blocks written 0 0 0 0.0%
WAL records 8,358 8,406 +48 -0.6%
WAL full-page images 856 849 -7 +0.8%
WAL bytes 6,418,908 6,542,083 +123,175 -1.9%

Positive improvement means reduced cost; negative means increased cost. Delta = after - before.

Base 5a566acd4148334c97d132ea5421c53a2118e886 → candidate ae25dc11cc1b2769cd32b347585eef9207104436.
Workflow run.

Head: ae25dc1 · base: 5a566ac

Measurements, query plans and job logs · attempt 1

Synthetic warmed scheduler/publisher workload; not production p95. Production reference: 92,581 articles on 2026-10-24. No deployment is performed.

@sonarqubecloud

Copy link
Copy Markdown

@abhi1693
abhi1693 merged commit 20b8fdf into master Oct 24, 2026
98 checks passed
@abhi1693
abhi1693 deleted the fix/299-topic-report-history branch October 24, 2026 22:08
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.

Reduce repeated historical topic JSON expansion in decision and inference reports

2 participants