Skip to content

Optimize JSON-Proto Conversion, Improve Memory Allocation, and Add Unit Tests - #5591

Merged
timvisee merged 2 commits into
qdrant:devfrom
redouan-rhazouani:lib_conv_json_proto
Dec 6, 2024
Merged

timvisee merged 2 commits into
qdrant:devfrom
redouan-rhazouani:lib_conv_json_proto

Conversation

@redouan-rhazouani

Copy link
Copy Markdown
Contributor
  • Memory Optimization: Improved allocation by eliminating raw loops.
  • Code Readability: Enhanced code readability by reducing nesting and restructuring logic for clarity.
  • Unit Tests: Added unit tests to assert correctness and reliability of the JSON-Proto conversion.

All Submissions:

  • Contributions should target the dev branch. Did you create your branch from dev?
  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?

New Feature Submissions:

  1. Does your submission pass tests?
  2. Have you formatted your code locally using cargo +nightly fmt --all command prior to submission?
  3. Have you checked your code using cargo clippy --all --all-features command?

Changes to Core Features:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your core changes, as applicable?
  • Have you successfully ran tests with your changes locally?

@timvisee
timvisee self-requested a review December 5, 2024 14:13

@timvisee timvisee left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thank you very much! 🙏

Out of curiosity, did you patch this to fix a measurable performance problem, or did you intend this to be just a nice to have?

Either way, thanks for the changes. I like the new loops with proper pre-allocation, and thanks for the tests.

Would you mind to run clippy to make the CI tests green. It may just be this one line below:

Comment thread lib/api/src/conversions/json.rs Resolved
 * mproved memory allocation by eliminating raw loops
 * Enhanced readability by reducing nesting and restructuring logic for clarity
 * Added tests to assert correctness and reliability of the JSON-Proto conversion process
@redouan-rhazouani

Copy link
Copy Markdown
Contributor Author

Thank you very much! 🙏

Out of curiosity, did you patch this to fix a measurable performance problem, or did you intend this to be just a nice to have?

Either way, thanks for the changes. I like the new loops with proper pre-allocation, and thanks for the tests.

Would you mind to run clippy to make the CI tests green. It may just be this one line below:

Thanks, Tim for the feedback! 😊 I'm passionate about vector DBs and Rust, so I try to contribute to OSS whenever I can. Glad you liked the changes! 🚀

@timvisee timvisee left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Sweet! Changes like this are always welcome.

Approved. I expect CI to go through now. Thanks again!

@timvisee

timvisee commented Dec 5, 2024

Copy link
Copy Markdown
Member

I expect CI to go through now.

Whoops, there seem to be some more.

Please run cargo clippy --workspace --all-targets -- -D warnings locally to ensure all lint warnings are handled.

@redouan-rhazouani

Copy link
Copy Markdown
Contributor Author

I expect CI to go through now.

Whoops, there seem to be some more.

Please run cargo clippy --workspace --all-targets -- -D warnings locally to ensure all lint warnings are handled.

Apologies for the inconvenience - this is my first contribution. I've resolved the issues, and it should work now. Thanks for pointing it out!

@redouan-rhazouani

Copy link
Copy Markdown
Contributor Author

Thank you very much! 🙏
Out of curiosity, did you patch this to fix a measurable performance problem, or did you intend this to be just a nice to have?
Either way, thanks for the changes. I like the new loops with proper pre-allocation, and thanks for the tests.
Would you mind to run clippy to make the CI tests green. It may just be this one line below:

Thanks, Tim for the feedback! 😊 I'm passionate about vector DBs and Rust, so I try to contribute to OSS whenever I can. Glad you liked the changes! 🚀

Thanks, guys! It’s my pleasure. 😊

@agourlay agourlay left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thank you for the contribution 👏

@timvisee
timvisee merged commit 0c55bcc into qdrant:dev Dec 6, 2024
timvisee pushed a commit that referenced this pull request Dec 9, 2024
…it Tests (#5591)

* Optimize JSON-Proto conversion and add unit tests
 * mproved memory allocation by eliminating raw loops
 * Enhanced readability by reducing nesting and restructuring logic for clarity
 * Added tests to assert correctness and reliability of the JSON-Proto conversion process

* Resolve clippy issues
@timvisee timvisee mentioned this pull request Dec 9, 2024
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.

3 participants