Skip to content

perf: replace ObjectNormalizer with json_(en/de)code (de)serializer - #49

Merged
bpolaszek merged 4 commits into
bpolaszek:mainfrom
geonativefr:perf/redis-serializer
Jul 6, 2026
Merged

bpolaszek merged 4 commits into
bpolaszek:mainfrom
geonativefr:perf/redis-serializer

Conversation

@LounisBou

Copy link
Copy Markdown
Contributor

Redis deserializes every message on every worker before any topic filtering. Deserializations using reflection per each publish can cost a lot.

This PR change it for json_encode/json_decode + constructor mapping over the trivial Update/Message DTOs (should be really cheaper per message).

  • Wire format is byte-compatible with the previous ObjectNormalizer output. This should be transparent change for Redis.
  • Message.id is keep (not regenerated).
  • Existing transport tests pass unchanged, proving equivalence.

@bpolaszek

Copy link
Copy Markdown
Owner

Sounds good to me, I even think we can remove symfony/serializer from deps, WDYT?

@codecov

codecov Bot commented Jul 3, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (babfcd2) to head (edc1b7d).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff             @@
##                main       #49   +/-   ##
===========================================
  Coverage     100.00%   100.00%           
+ Complexity       165       164    -1     
===========================================
  Files             27        27           
  Lines            437       465   +28     
===========================================
+ Hits             437       465   +28     

☔ 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.

The Redis transport no longer uses it at runtime; the wire-compat test
keeps it as a dev dependency via a legacy_redis_serializer() helper.
@LounisBou

Copy link
Copy Markdown
Contributor Author

Sounds good to me, I even think we can remove symfony/serializer from deps, WDYT?

I choose to keep it as dev dependency so tests prove new format is the same as symfony/serializer

@bpolaszek
bpolaszek merged commit ed9d6e4 into bpolaszek:main Jul 6, 2026
18 checks passed
@bpolaszek

Copy link
Copy Markdown
Owner

Thank you @LounisBou !

@LounisBou LounisBou mentioned this pull request Jul 7, 2026
@misaert
misaert deleted the perf/redis-serializer branch July 7, 2026 14:44
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