simplemage/module-indexer-benchmark

SimpleMage Indexer Benchmark — dev-only verification harness for SimpleMage_CategoryProductIndexer: before/after benchmark commands, metric collectors, MD5 correctness verification. Staging/dev use only.

Maintainers

Package info

github.com/SimpleMage/magento2-indexer-benchmark

Homepage

Issues

Type:magento2-module

pkg:composer/simplemage/module-indexer-benchmark

Transparency log

Statistics

Installs: 0

Dependents: 0

Suggesters: 1

Stars: 0

v1.0.0 2026-06-12 17:05 UTC

This package is auto-updated.

Last update: 2026-07-04 07:51:52 UTC


README

Dev-only companion module for SimpleMage_CategoryProductIndexer. It measures the before/after performance of the catalog_category_product indexer on YOUR database and proves the index output is byte-for-byte identical to core Magento - every row, every column, every store view, MD5-compared.

⚠️ Staging / development environments only. This module resets indexer state, flushes caches and dumps index tables. Never install it on production. Nothing ever leaves your server - all results are local files under var/simplemage-bench/.

Requirements

  • Magento Open Source 2.4.6 - 2.4.9 or Mage-OS 1.x - 3.x, PHP 8.2 - 8.5
  • A staging copy of your store database (the bigger the catalog, the better)
  • The SimpleMage_CategoryProductIndexer module files in app/code/ (disabled at first!)

Beta test - 5 steps

# 0. Install the harness (SimpleMage_CategoryProductIndexer stays DISABLED for now)
bin/magento module:enable SimpleMage_IndexerBenchmark
bin/magento setup:upgrade && bin/magento setup:di:compile

# 1. BASELINE - measure core Magento on your data
bin/magento simplemage:bench:run -i catalog_category_product -m baseline
bin/magento simplemage:bench:snapshot -i catalog_category_product -l core

# 2. Enable the SimpleMage indexer module
bin/magento module:enable SimpleMage_CategoryProductIndexer
bin/magento setup:upgrade && bin/magento setup:di:compile

# 3. CANDIDATE - measure the SimpleMage path on the same data
bin/magento simplemage:bench:run -i catalog_category_product -m candidate
bin/magento simplemage:bench:snapshot -i catalog_category_product -l simplemage -d core

# 4. Full report: timings + byte-identity verdict
bin/magento simplemage:bench:compare -i catalog_category_product \
    --snapshot-baseline=core --snapshot-candidate=simplemage

That's it. Step 3's -d core already prints the MD5 verdict (Snapshots MATCH / DIFFER); step 4 adds the side-by-side metric table. Please send us the full console output of step 4 (and step 3 if it reported DIFFER).

🔒 Do not change the catalog between step 1 and step 3 (disable cron) - any product/category change in between produces a false DIFFER.

Optional: partial-reindex benchmark

Partial (MView) reindex is the production hot path - worth measuring too. The same seed guarantees baseline and candidate use the identical ID sample:

# before enabling the module:
bin/magento simplemage:bench:run-partial -i catalog_product_category -c 100 -m baseline
# after enabling:
bin/magento simplemage:bench:run-partial -i catalog_product_category -c 100 -m candidate

Commands

Command Purpose
simplemage:bench:run -i <indexer> -m baseline|candidate [-l label] [--skip-reset] Full reindex with metric collection (wall clock, peak memory, SQL query count/time, slow queries, lock waits, tmp disk tables)
simplemage:bench:snapshot -i <indexer> -l <label> [-d <other-label>] Deterministic full-content dump of the live index tables; with -d, saves AND diffs against an earlier label (MD5 + line diff)
simplemage:bench:compare -i <indexer> [-l label] [--snapshot-baseline=A --snapshot-candidate=B] [--strict] [--threshold=10] Baseline vs candidate metric table, regression flags, optional snapshot verdict
simplemage:bench:run-partial -i <indexer> -c <n> -m <mode> [--seed 42] [--ids 1,2,3] Partial reindex (reindexList) benchmark on a deterministic ID sample

How the correctness check works

simplemage:bench:snapshot dumps every row of every catalog_category_product_index_store* table (the live, post-switch tables - excluding _replica/_tmp/_outdated) in canonical order with all columns serialised per line, then compares files via streaming MD5. A MATCH means the SimpleMage indexer produced literally identical data to core on your catalog. No sampling, no aggregation limits, table-prefix aware.

License

MIT - see LICENSE.