Giter Site home page Giter Site logo

Comments (5)

j82w avatar j82w commented on August 16, 2024

Hi @AndriySvyryd ,

What is the use case for this?

from azure-cosmos-dotnet-v3.

AndriySvyryd avatar AndriySvyryd commented on August 16, 2024

@j82w

  1. Consistency with other API like CreateItemStreamAsync
  2. Control over how the parameters are serialized without having to replace CosmosJsonSerializer
  3. Writing to the stream directly is more efficient than going through an object first

from azure-cosmos-dotnet-v3.

j82w avatar j82w commented on August 16, 2024

The other APIs were done for performance reasons. With query the SDK does a lot of logic to figure out what partition to go to, and how to combine/sort the results for queries when the results are from multiple partitions. Since this logic is done in the SDK it would end up deserializing the stream that was just created, and would actually hurt the performance.

from azure-cosmos-dotnet-v3.

vladrai avatar vladrai commented on August 16, 2024

We did some testing on a fairly large data (ended up with 100+ physical partitions). Cross partition query parts de-serialized on a client for ORDER-BY merge purposes required a lot of CPU + garbage, causing as a result GC to not be able to clean all used JSON serialization primitives leading to filling all the memory in addition to high CPU. This feature supposed to allow ORDER-BY query parts to be processed on client without complete de-serialization of query parts from partitions. Is my understanding correct here?

from azure-cosmos-dotnet-v3.

j82w avatar j82w commented on August 16, 2024

@vladrai the original post was about taking a stream as a input. The issue you are reporting is around how the SDK handles responses which has recently been completely overhauled to improve this scenario. The SDK now only lazily deserializes the fields that are need instead of the entire object. Please take a look at the following PRs for more information.

  1. #62
  2. #66
  3. #78

Please tryout the latest 3.0.0.9-Preview which should have all the changes.

from azure-cosmos-dotnet-v3.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.