Skip to content

MOD-18895 - optimize mem allocation - #1660

Merged
TalBarYakar merged 10 commits into
masterfrom
tal.ba/opt_mem_allocation
Oct 6, 2026
Merged

TalBarYakar merged 10 commits into
masterfrom
tal.ba/opt_mem_allocation

Conversation

@TalBarYakar

@TalBarYakar TalBarYakar commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Note

Medium Risk
Touches the hot JSON ingest path and in-memory representation, which can shift memory accounting and edge-case behavior despite added tests; CI comparison is informational only and does not gate merges.

Overview
Reduces JSON object memory by bumping ijson and parsing through deserialize_compact_objects in RedisIValueJsonKeyManager::from_str instead of the generic deserializer. A new unit test locks in depth-limit behavior and expected object capacity; JSON.DEBUG memory expectations in Rust tests move down (e.g. 544 → 480).

Adds non-gating observability: a reusable flow-memory-comparison.yml workflow (current vs master, shared Redis build, artifact report) plus tests/pytest/memory_comparison.py, hooked from PR CI and nightly. Pytest no longer pins absolute JSON.DEBUG MEMORY totals where layout changed—default-path checks now assert a positive integer and match the explicit $ path.

Reviewed by Cursor Bugbot for commit 811e3e1. Bugbot is set up for automated code reviews on this repo. Configure here.

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Stale Bugbot comment from a previous run.

needs: [prepare-values]
uses: ./.github/workflows/flow-memory-comparison.yml
with:
redis-ref: ${{ needs.prepare-values.outputs.redis-ref }}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Comparison job lacks PR skip guards

Low Severity

memory-comparison only needs prepare-values and has no if condition. Unlike memory-regression, it still runs on draft PRs and docs-only changes. Each run builds Redis plus two release modules, downloads the city fixture, and can take up to 45 minutes, even though the job cannot fail the PR.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit a8fd7cf. Configure here.

@TalBarYakar
TalBarYakar force-pushed the tal.ba/opt_mem_allocation branch from 9f47c60 to 07158c1 Compare October 1, 2026 17:46
@codecov

codecov Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.13%. Comparing base (fbe6eae) to head (811e3e1).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1660   +/-   ##
=======================================
  Coverage   88.13%   88.13%           
=======================================
  Files          17       17           
  Lines        6049     6049           
=======================================
  Hits         5331     5331           
  Misses        718      718           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@TalBarYakar
TalBarYakar force-pushed the tal.ba/opt_mem_allocation branch 2 times, most recently from 07158c1 to 07b2bcf Compare October 5, 2026 12:20

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

There are 2 total unresolved issues (including 1 from previous review).

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 07b2bcf. Configure here.

Comment thread tests/pytest/memory_comparison.py Outdated
'Fixtures: existing nightly small/medium/large; large_repetition adds the historical '
'19-byte string 400 times. City uses one full citylots document. '
'Raw readback hashes must agree across both versions and all trials.', '',
'| Scenario | Keys / SETs per run | Master process B | Current process B | Change | '

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please make the columns header more clear

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done

Label memory and SET timing columns with explicit units and percentage
changes. Align workflow dependencies with the existing Python setup and
check script imports before building.
@TalBarYakar TalBarYakar changed the title Tal.ba/opt mem allocation MOD-18895 - optimize mem allocation Oct 6, 2026
@TalBarYakar
TalBarYakar merged commit 69ce39c into master Oct 6, 2026
115 of 118 checks passed
@TalBarYakar
TalBarYakar deleted the tal.ba/opt_mem_allocation branch October 6, 2026 12:21
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.

2 participants