GithubHelp home page GithubHelp logo

possible performance problems about kohttp HOT 1 OPEN

alosdev avatar alosdev commented on September 27, 2024 1
possible performance problems

from kohttp.

Comments (1)

rybalkinsd avatar rybalkinsd commented on September 27, 2024

Thanks for posting this issue @alosdev!

Overall, It's a great idea to introduce a simplified API to work with response streaming.

Indeed, in the quoted file we load the whole response.
The main idea of .toType extension is to deserialise simple/small bodies as type T

val simple: SimpleClass? = it.toType()

In this case we have an extra allocation(for tmp string) + sequential processing vs streaming processing overhead.
In my mind it would be great to have a benchmark to make a decision.
Do you have any use case in your mind?

From my understanding getting deserialized type T or JsonNode itself will not radically change the situation (the whole object will be in memory after parsing)
However parsing arrays of to Stream<T> or fetching a particular filed(sub-object) from a huge body could help.
Do you have any thoughts about API?

from kohttp.

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.