Skip to content

feat(performance): Workload-Adaptive Optimization – Issue #230 (v1.9.0) - #4619

Merged
makr-code merged 3 commits into
developfrom
copilot/add-workload-adaptive-optimization
Apr 13, 2026
Merged

makr-code merged 3 commits into
developfrom
copilot/add-workload-adaptive-optimization

Conversation

Copilot AI commented Apr 13, 2026 •

Copy link
Copy Markdown
Contributor

Wires the WorkloadAdaptiveOptimizer (SIGMOD'19 "Adaptive Execution") into the build system and documents it. Implementation source files were already on the branch; this PR completes the integration.

Description

Core implementation (include/performance/workload_adaptive_optimizer.h + src/performance/workload_adaptive_optimizer.cpp) — already present:

  • WorkloadType enum: OLTP / OLAP / MIXED / GRAPH / VECTOR / TIMESERIES / UNKNOWN
  • WorkloadProfile snapshot from a 512-query rolling observation window (read/write ratio, avg complexity, avg result size, concurrency, top-3 hot tables)
  • OptimizationStrategy per workload type (JIT flag, thread pool size, cache MB, join algorithm, index type); predictive pool scaling at concurrency × 1.25 when load exceeds base
  • Background adaptation loop (enable_auto_adapt(interval)) + AdaptationCallback(old, new, strategy)
  • Full thread safety via fine-grained mutexes
WorkloadAdaptiveOptimizer opt;
opt.set_concurrent_queries(16);
for (auto& q : recent_queries)
    opt.record_query(q.is_write, q.complexity, q.rows, q.table, q.latency_us);

opt.set_callback([](auto& old_p, auto& new_p, auto& s) {
    thread_pool.resize(s.thread_pool_size);
    cache.resize_mb(s.cache_size_mb);
});
opt.enable_auto_adapt(std::chrono::seconds{30});

Build integration (cmake/CMakeLists.txt):

  • Added test_workload_adaptive_optimizer GTest target (mirrors test_workload_predictor pattern)

Documentation:

  • src/performance/ROADMAP.md — Phase 5 added (11 checkboxes), item marked complete in Completed section, Production Readiness Checklist updated
  • compendium/docs/chapter_39_performance_tuning_cookbook.md — §39.15 with C++ API examples and full strategy reference table
  • compendium/docs/appendix_d_feature_status.md — 3 GA rows for classify_workload(), get_strategy(), enable_auto_adapt()

Linked Issues

Type of Change

  • Bug fix (non-breaking)
  • New feature (non-breaking)
  • Refactoring (non-breaking)
  • Documentation
  • Breaking change (requires MAJOR version bump — see VERSIONING.md)
  • Security fix
  • Other:

Breaking Change Checklist

  • MAJOR version bump planned in VERSION and CMakeLists.txt
  • Migration guide added in docs/migration/
  • Announcement prepared for GitHub Discussions (≥ 2 weeks before release)
  • CHANGELOG ### Removed / ### Changed section updated

Testing

  • Unit tests added/updated
  • Integration tests added/updated
  • Manual testing performed
  • Benchmarks run (if performance-sensitive change)

16 focused tests in tests/test_workload_adaptive_optimizer.cpp cover construction, per-type classification (OLTP/OLAP/MIXED/VECTOR), strategy selection, predictive scaling, AdaptationCallback dispatch, auto-adapt enable/disable, stats reset, and concurrent record_query thread safety.

📚 Research & Knowledge (wenn applicable)

  • Diese PR basiert auf wissenschaftlichen Paper(s) oder Best Practices?
    • Falls JA: Research-Dateien in /docs/research/ angelegt?
    • Falls JA: Im Modul-README unter "Wissenschaftliche Grundlagen" verlinkt?
    • Falls JA: In /docs/research/implementation_influence/ eingetragen?

Relevante Quellen:

  • Paper: "Adaptive Execution" (SIGMOD'19)
  • Best Practice:
  • Architecture Decision:

Checklist

  • Code follows project style guidelines (clang-format / clang-tidy)
  • Self-review completed
  • Documentation updated (if needed)
  • CHANGELOG.md updated under [Unreleased]
  • No new warnings introduced
  • Security-sensitive paths reviewed by security maintainer (if applicable)

Copilot AI linked an issue Apr 13, 2026 that may be closed by this pull request
8 tasks
Copilot AI changed the title [WIP] Implement workload-adaptive optimization for performance domain feat(performance): Workload-Adaptive Optimization – Issue #230 (v1.9.0) Apr 13, 2026
Copilot AI requested a review from makr-code April 13, 2026 11:29
@makr-code
makr-code marked this pull request as ready for review April 13, 2026 11:31
@makr-code
makr-code merged commit fd206c4 into develop Apr 13, 2026
98 of 111 checks passed
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.

Workload-Adaptive Optimization

2 participants