8000 Experimental support for JSON serialization with `simdjson` by michael-grunder · Pull Request #2814 · phpredis/phpredis · GitHub
[go: up one dir, main page]

Skip to content

Experimental support for JSON serialization with simdjson#2814

Draft
michael-grunder wants to merge 1 commit intodevelopfrom
simdjson
Draft

Experimental support for JSON serialization with simdjson#2814
michael-grunder wants to merge 1 commit intodevelopfrom
simdjson

Conversation

@michael-grunder
Copy link
Member

This commit adds conditional support for simdjson based JSON deserialization.

To enable compile with --enable-redis-simdjson and PhpRedis will attempt to find and link with the simdjson shared library. The feature likely requires simdjson >= 4.0.0 and was tested with 4.3.1.

Enabling is just like other serializers:

$redis->setOption(Redis::OPT_SERIALIZER, Redis::SERIALIZER_SIMDJSON);
$redis->set('foo', ['bar' => 'baz']);
print_r($redis->get('foo'));

Initial tests do show aa huge performance improvement in deserializing json payloads (2-3.5x depending on the payloads themselves).

This commit adds conditional support for simdjson based JSON
deserialization.

To enable compile with `--enable-redis-simdjson` and PhpRedis will
attempt to find and link with the `simdjson` shared library. The feature
likely requires simdjson >= `4.0.0` and was tested with `4.3.1`.

Enabling is just like other serializers:

```php
$redis->setOption(Redis::OPT_SERIALIZER, Redis::SERIALIZER_SIMDJSON);
$redis->set('foo', ['bar' => 'baz']);
print_r($redis->get('foo'));
```

Initial tests do show aa huge performance improvement in deserializing
json payloads (2-3.5x depending on the payloads themselves).
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.

1 participant

0