Skip to content

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

Closed
LounisBou wants to merge 4 commits into
mainfrom
perf/redis-serializer
Closed

LounisBou wants to merge 4 commits into
mainfrom
perf/redis-serializer

Conversation

@LounisBou

@LounisBou LounisBou commented Jul 1, 2026 •

Copy link
Copy Markdown

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.

@LounisBou LounisBou changed the title perf: replace ObjectNormalizer with a hand-rolled Redis (de)serializer perf: replace ObjectNormalizer with json_(en/de)code (de)serializer Jul 1, 2026
Comment thread src/Hub/Transport/Redis/RedisSerializer.php Outdated
@LounisBou
LounisBou requested a review from misaert July 1, 2026 15:32

@misaert misaert 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.

Can you send this PR to origin repository?

Comment thread src/Hub/Transport/Redis/RedisSerializer.php
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 LounisBou closed this 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