-
Notifications
You must be signed in to change notification settings - Fork 332
Introduction of ijson to reduce memory consumption #563
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
* Return serde_json:Value support * Implement manager for IValue
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! Just small non-blocking comments
get_manage: { | ||
match MANAGER { | ||
ManagerType::IValue => Some(ivalue_manager::RedisIValueJsonKeyManager{phantom:PhantomData}), | ||
_ => None, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can already handle ManagerType::SerdeValue
also here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, because then you have a match that return different types
src/ivalue_manager.rs
Outdated
if path.is_empty() { | ||
// update the root | ||
let root = self.get_value().unwrap().unwrap(); | ||
let val = if root.is_object() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can avoid is_object
with something like
if let Some(o) = root.as_object_mut()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
v.serialize(&mut out).unwrap(); | ||
self.from_str( | ||
&String::from_utf8(out.into_inner()).unwrap(), | ||
Format::JSON, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not for now (there are missing implementations and tests for BSON), but maybe could be done without passing through JSON string?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to add support for this on ijson repository
… that can get either SERDE_JSON or IJSON, default is IJSON.
Fix #569 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍🏼
@gkorland @MeirShpilraien @oshadmi , adding a bit of context of the small regressions this PR will add to the achievable ops/sec ( at the benefit of large memory savings ). regressions/potential regressions only:
full data:
|
* initial ijson commit * Code arrangement * Return serde_json:Value support * Implement manager for IValue * Implement lasts unimplimented manager API for IValue * fmt fixes * return jsonpath library to point to generic_json_path * Made backend configurable on start using JSON_BACKEND module argument that can get either SERDE_JSON or IJSON, default is IJSON. * run tests on both backends * json_init -> json_init_config * fmt fixes * tests fixes * fmt fixes * disable memory test as its currently incorrect * review fixes * update redismodule-rs to 0.25 * fix 6.0 tests * Skip short read test on 6.0 (too slow) * Skip module keyspace notification test (introduced in redis 6.2) Co-authored-by: meir <meir@redis.com> Co-authored-by: oshadmi <omer.shadmi@redislabs.com> (cherry picked from commit b6a070d)
* Fixes in config.yml (#409) (cherry picked from commit 8adfd29) * Updated module version * json.get returns a top-level array (as bulk string) (#411) (#412) * json.get returns a top-level array (as bulk string) * Fix format and tests (cherry picked from commit cc6d225) * Updated modules version (2) * Added integration branch 2.0 * Updated module version * Updated modules version (2) * Added integration branch 2.0 * [2.0] Updated readies * [2.0] Updated readies (for docker cpuset) * update readies to master * Update version to 2.0.2 * Update Cargo.toml version to 2.0.2 * Update deps: jsonpath tag v2.0.2 * Multipath: handle default arguments (#503) * Multipath: arrlen - handle missing path * Multipath: handle/add tests for default args (strlen objkeys objlen resp get strappend arrpop) (cherry picked from commit 8733934) * QA automation update (#505) (cherry picked from commit 223316f) * system-setup: added binutils for macOS (objcopy) (#524) (cherry picked from commit e6da70b) * [2.0] Cherry-pick #524, updated readies * Update version to 2.0.3 * Update readies * Bump version to 2.0.4 * Update commands.json file (2) (#534) (cherry picked from commit 58ea6f1) * Updated RS_VERSIONS (#536) (cherry picked from commit d7ee051) * Doc 2.0 (#538) (#540) * Document new path, JSON.GET and JSON.MGET * Add examples and update results for all commands * Update complexity information * Update docs/commands.md Co-authored-by: Omer Shadmi <76992134+oshadmi@users.noreply.github.com> * Update docs/commands.md Co-authored-by: Omer Shadmi <76992134+oshadmi@users.noreply.github.com> * Add example to NUMINCRBY. Fix example in NUMMULTBY * Update docs/commands.md Co-authored-by: Omer Shadmi <76992134+oshadmi@users.noreply.github.com> * Update docs/commands.md Co-authored-by: Omer Shadmi <76992134+oshadmi@users.noreply.github.com> * Post review rephrasing * Update docs/commands.md Co-authored-by: Omer Shadmi <76992134+oshadmi@users.noreply.github.com> * Add indexing JSON documents * Post review * Update docs/indexing_JSON.md Co-authored-by: Omer Shadmi <76992134+oshadmi@users.noreply.github.com> Co-authored-by: Omer Shadmi <76992134+oshadmi@users.noreply.github.com> Co-authored-by: Omer Shadmi <76992134+oshadmi@users.noreply.github.com> * Add indexing json doc (#543) * Doc 2.0 (#538) * Document new path, JSON.GET and JSON.MGET * Add examples and update results for all commands * Update complexity information * Update docs/commands.md Co-authored-by: Omer Shadmi <76992134+oshadmi@users.noreply.github.com> * Update docs/commands.md Co-authored-by: Omer Shadmi <76992134+oshadmi@users.noreply.github.com> * Add example to NUMINCRBY. Fix example in NUMMULTBY * Update docs/commands.md Co-authored-by: Omer Shadmi <76992134+oshadmi@users.noreply.github.com> * Update docs/commands.md Co-authored-by: Omer Shadmi <76992134+oshadmi@users.noreply.github.com> * Post review rephrasing * Update docs/commands.md Co-authored-by: Omer Shadmi <76992134+oshadmi@users.noreply.github.com> * Add indexing JSON documents * Post review * Update docs/indexing_JSON.md Co-authored-by: Omer Shadmi <76992134+oshadmi@users.noreply.github.com> Co-authored-by: Omer Shadmi <76992134+oshadmi@users.noreply.github.com> * Add indexing json to the doc * update to latest readies Co-authored-by: Omer Shadmi <76992134+oshadmi@users.noreply.github.com> Co-authored-by: oshadmi <omer.shadmi@redislabs.com> * Build system updates (esp. target into BINDIR) (#547) (cherry picked from commit 09c4618) * [2.0] Updated readies * [2.0] Dockerfile: updated REDISEARCH_VERSION * ARM support (#550) (cherry picked from commit c3ed883) * Bump version to 2.0.5 * Build ARM for bionic; test with Redis 6.0 (#556) (#557) (cherry picked from commit b1c8cb4) * initial ijson commit (#563) * initial ijson commit * Code arrangement * Return serde_json:Value support * Implement manager for IValue * Implement lasts unimplimented manager API for IValue * fmt fixes * return jsonpath library to point to generic_json_path * Made backend configurable on start using JSON_BACKEND module argument that can get either SERDE_JSON or IJSON, default is IJSON. * run tests on both backends * json_init -> json_init_config * fmt fixes * tests fixes * fmt fixes * disable memory test as its currently incorrect * review fixes * update redismodule-rs to 0.25 * fix 6.0 tests * Skip short read test on 6.0 (too slow) * Skip module keyspace notification test (introduced in redis 6.2) Co-authored-by: meir <meir@redis.com> Co-authored-by: oshadmi <omer.shadmi@redislabs.com> (cherry picked from commit b6a070d) * path.md copyedit suggestions (cherry picked from commit 57e6a87) * indexing_JSON.md copyedit suggestions (cherry picked from commit 8cf0cd4) * Update Cargo.toml (#552) Co-authored-by: Rafi Einstein <rafi@redislabs.com> (cherry picked from commit 42e6f32) * Update freebsd.yml (#565) * Update freebsd.yml (cherry picked from commit 58d6fbf) * JSON.SET full doc benchmark extensions (#568) * JSON.SET full doc benchmark extensions * [fix] Adjusted json_vs_hashes_json.set_key_simple to use a larger keyspace range * [fix] Fixed q5 JSON.SET test (cherry picked from commit 3ec45da) * Bump mkdocs from 1.1.2 to 1.2.3 in /docs (#572) Bumps [mkdocs](https://github.com/mkdocs/mkdocs) from 1.1.2 to 1.2.3. - [Release notes](https://github.com/mkdocs/mkdocs/releases) - [Commits](mkdocs/mkdocs@1.1.2...1.2.3) --- updated-dependencies: - dependency-name: mkdocs dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> (cherry picked from commit 91892dd) * Add docs fo JSON.CLEAR and JSON.TOGGLE (#474) (#607) * fix #465 Add docs for JSON.CLEAR and JSON.TOGGLE * Document adding a new child with JSON.SET (#622) (#626) * Document adding a new child with JSON.SET * Restoring previous edits * Restoring previous edits (2) (cherry picked from commit cd2458d) Co-authored-by: Rafi Einstein <rafi@redislabs.com> Co-authored-by: Emmanuel Keller <74923777+emmanuelkeller@users.noreply.github.com> Co-authored-by: Guy Korland <gkorland@gmail.com> Co-authored-by: Rachel Elledge <86307637+rrelledge@users.noreply.github.com> Co-authored-by: filipe oliveira <filipecosta.90@gmail.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* Merge from master to 2.0 (towards 2.0.7) (#665) * Fixes in config.yml (#409) (cherry picked from commit 8adfd29) * Updated module version * json.get returns a top-level array (as bulk string) (#411) (#412) * json.get returns a top-level array (as bulk string) * Fix format and tests (cherry picked from commit cc6d225) * Updated modules version (2) * Added integration branch 2.0 * Updated module version * Updated modules version (2) * Added integration branch 2.0 * [2.0] Updated readies * [2.0] Updated readies (for docker cpuset) * update readies to master * Update version to 2.0.2 * Update Cargo.toml version to 2.0.2 * Update deps: jsonpath tag v2.0.2 * Multipath: handle default arguments (#503) * Multipath: arrlen - handle missing path * Multipath: handle/add tests for default args (strlen objkeys objlen resp get strappend arrpop) (cherry picked from commit 8733934) * QA automation update (#505) (cherry picked from commit 223316f) * system-setup: added binutils for macOS (objcopy) (#524) (cherry picked from commit e6da70b) * [2.0] Cherry-pick #524, updated readies * Update version to 2.0.3 * Update readies * Bump version to 2.0.4 * Update commands.json file (2) (#534) (cherry picked from commit 58ea6f1) * Updated RS_VERSIONS (#536) (cherry picked from commit d7ee051) * Doc 2.0 (#538) (#540) * Document new path, JSON.GET and JSON.MGET * Add examples and update results for all commands * Update complexity information * Update docs/commands.md Co-authored-by: Omer Shadmi <76992134+oshadmi@users.noreply.github.com> * Update docs/commands.md Co-authored-by: Omer Shadmi <76992134+oshadmi@users.noreply.github.com> * Add example to NUMINCRBY. Fix example in NUMMULTBY * Update docs/commands.md Co-authored-by: Omer Shadmi <76992134+oshadmi@users.noreply.github.com> * Update docs/commands.md Co-authored-by: Omer Shadmi <76992134+oshadmi@users.noreply.github.com> * Post review rephrasing * Update docs/commands.md Co-authored-by: Omer Shadmi <76992134+oshadmi@users.noreply.github.com> * Add indexing JSON documents * Post review * Update docs/indexing_JSON.md Co-authored-by: Omer Shadmi <76992134+oshadmi@users.noreply.github.com> Co-authored-by: Omer Shadmi <76992134+oshadmi@users.noreply.github.com> Co-authored-by: Omer Shadmi <76992134+oshadmi@users.noreply.github.com> * Add indexing json doc (#543) * Doc 2.0 (#538) * Document new path, JSON.GET and JSON.MGET * Add examples and update results for all commands * Update complexity information * Update docs/commands.md Co-authored-by: Omer Shadmi <76992134+oshadmi@users.noreply.github.com> * Update docs/commands.md Co-authored-by: Omer Shadmi <76992134+oshadmi@users.noreply.github.com> * Add example to NUMINCRBY. Fix example in NUMMULTBY * Update docs/commands.md Co-authored-by: Omer Shadmi <76992134+oshadmi@users.noreply.github.com> * Update docs/commands.md Co-authored-by: Omer Shadmi <76992134+oshadmi@users.noreply.github.com> * Post review rephrasing * Update docs/commands.md Co-authored-by: Omer Shadmi <76992134+oshadmi@users.noreply.github.com> * Add indexing JSON documents * Post review * Update docs/indexing_JSON.md Co-authored-by: Omer Shadmi <76992134+oshadmi@users.noreply.github.com> Co-authored-by: Omer Shadmi <76992134+oshadmi@users.noreply.github.com> * Add indexing json to the doc * update to latest readies Co-authored-by: Omer Shadmi <76992134+oshadmi@users.noreply.github.com> Co-authored-by: oshadmi <omer.shadmi@redislabs.com> * Build system updates (esp. target into BINDIR) (#547) (cherry picked from commit 09c4618) * [2.0] Updated readies * [2.0] Dockerfile: updated REDISEARCH_VERSION * ARM support (#550) (cherry picked from commit c3ed883) * Bump version to 2.0.5 * Build ARM for bionic; test with Redis 6.0 (#556) (#557) (cherry picked from commit b1c8cb4) * initial ijson commit (#563) * initial ijson commit * Code arrangement * Return serde_json:Value support * Implement manager for IValue * Implement lasts unimplimented manager API for IValue * fmt fixes * return jsonpath library to point to generic_json_path * Made backend configurable on start using JSON_BACKEND module argument that can get either SERDE_JSON or IJSON, default is IJSON. * run tests on both backends * json_init -> json_init_config * fmt fixes * tests fixes * fmt fixes * disable memory test as its currently incorrect * review fixes * update redismodule-rs to 0.25 * fix 6.0 tests * Skip short read test on 6.0 (too slow) * Skip module keyspace notification test (introduced in redis 6.2) Co-authored-by: meir <meir@redis.com> Co-authored-by: oshadmi <omer.shadmi@redislabs.com> (cherry picked from commit b6a070d) * path.md copyedit suggestions (cherry picked from commit 57e6a87) * indexing_JSON.md copyedit suggestions (cherry picked from commit 8cf0cd4) * Update Cargo.toml (#552) Co-authored-by: Rafi Einstein <rafi@redislabs.com> (cherry picked from commit 42e6f32) * Update freebsd.yml (#565) * Update freebsd.yml (cherry picked from commit 58d6fbf) * JSON.SET full doc benchmark extensions (#568) * JSON.SET full doc benchmark extensions * [fix] Adjusted json_vs_hashes_json.set_key_simple to use a larger keyspace range * [fix] Fixed q5 JSON.SET test (cherry picked from commit 3ec45da) * Bump mkdocs from 1.1.2 to 1.2.3 in /docs (#572) Bumps [mkdocs](https://github.com/mkdocs/mkdocs) from 1.1.2 to 1.2.3. - [Release notes](https://github.com/mkdocs/mkdocs/releases) - [Commits](mkdocs/mkdocs@1.1.2...1.2.3) --- updated-dependencies: - dependency-name: mkdocs dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> (cherry picked from commit 91892dd) * Add docs fo JSON.CLEAR and JSON.TOGGLE (#474) (#607) * fix #465 Add docs for JSON.CLEAR and JSON.TOGGLE * Document adding a new child with JSON.SET (#622) (#626) * Document adding a new child with JSON.SET * Restoring previous edits * Restoring previous edits (2) (cherry picked from commit cd2458d) Co-authored-by: Rafi Einstein <rafi@redislabs.com> Co-authored-by: Emmanuel Keller <74923777+emmanuelkeller@users.noreply.github.com> Co-authored-by: Guy Korland <gkorland@gmail.com> Co-authored-by: Rachel Elledge <86307637+rrelledge@users.noreply.github.com> Co-authored-by: filipe oliveira <filipecosta.90@gmail.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * revert bad merge (#668) * revert bad merge (2) (#669) * Add test to MOD2099 + update dep to latest generic_json_path (#671) * Fox JSON.CLEAR doc * Allow QA tests on a specific RS_VERSION (#682) * Build fixes, inc. Rocky Linux 8 (#685) * Build fixes, inc. Rocky Linux 8 * Use jsonpath lib with fix for issue #667 (#691) * Upgrade to latest jsonpath lib and add test for issue 667 * Fix comment * MOD-2785: Add benchmark for issue #674 (#693) * Add benchmark for issue #674 * Fix yml * Using memtier_benchmark for more granular control on json_recursive_descent_with_filter_uid_issue674 benchmark Co-authored-by: filipecosta90 <filipecosta.90@gmail.com> * Update release.json remove xenial - not supported add rhel8 * Enabled CI profilers (#692) * Enabled CI profilers * Enabled dwarf call graph mode and fail-fast on CI perf Co-authored-by: Rafi Einstein <rafi@redislabs.com> Co-authored-by: Emmanuel Keller <74923777+emmanuelkeller@users.noreply.github.com> Co-authored-by: Guy Korland <gkorland@gmail.com> Co-authored-by: Rachel Elledge <86307637+rrelledge@users.noreply.github.com> Co-authored-by: filipe oliveira <filipecosta.90@gmail.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: tomerhekredis <72793005+tomerhekredis@users.noreply.github.com>
No description provided.