Code Monkey home page Code Monkey logo

Comments (5)

lancepantz avatar lancepantz commented on June 12, 2024

Jan,
Thanks for the heads up! That's a recent addition, I had no idea it was that detrimental to performance. clj-json is intended to be highly performant, I'll make fixing this a high priority.
I suspect it's the postwalk.
Thanks again!
-lance

On Monday, September 19, 2011 at 12:48 AM, Jan Rychter wrote:

Hi,

Since clojure.data.json is a big performance problem in our app (nearly 30% of request servicing time), I decided to try clj-json. Unfortunately, it isn't much of an improvement, and all because of a tiny issue. On our data, the "coerce" stage constitutes over 91% of cpu time spent in clj-json!

Since we actually do not need any coercing at all, I tested a variant of generate-string with the call to coerce removed. We get excellent performance that way.

Oh, and before you ask - this is a search engine and every millisecond counts. We really do care about performance.

Please provide a fast variant of generate-string for those of us who do not need any fancy conversions. I would submit a pull request, but it's a really simple fix, I can think of several ways this can be implemented and I think it is up to the library author to decide.

thanks,
--J.

Reply to this email directly or view it on GitHub:
#11

from clj-json.

jwr avatar jwr commented on June 12, 2024

Yes, it's the postwalk — and in our case we'd like to have a way to short-circuit it completely. When generating JSON replies we need to be as fast as possible and we only use a subset of JSON anyway.

Thanks and I'll be waiting for a clojars release so that we can use it!

from clj-json.

lancepantz avatar lancepantz commented on June 12, 2024

Hi Jan,
I just released version 0.4.1 to clojars, removing the post walk. Let me know how it performs for you.
-lance

On Monday, September 19, 2011 at 12:20 PM, Jan Rychter wrote:

Yes, it's the postwalk — and in our case we'd like to have a way to short-circuit it completely. When generating JSON replies we need to be as fast as possible and we only use a subset of JSON anyway.

Thanks and I'll be waiting for a clojars release so that we can use it!

Reply to this email directly or view it on GitHub:
#11 (comment)

from clj-json.

jwr avatar jwr commented on June 12, 2024

Hi,

0.4.1 works great. I haven't tried any coercions, though — so I can't comment on how those perform. But in our case we only need the fast path and that works great now.

Thanks for the quick response!

--J.

from clj-json.

lancepantz avatar lancepantz commented on June 12, 2024

Great to hear! I also pushed 0.4.2 a little later with performant support for anything that implements the Iterator interface. That probably eliminates most of the need for coercions.

Thanks again for the notice,
lance

On Tuesday, September 20, 2011 at 12:37 AM, Jan Rychter wrote:

Hi,

0.4.1 works great. I haven't tried any coercions, though — so I can't comment on how those perform. But in our case we only need the fast path and that works great now.

Thanks for the quick response!

--J.

Reply to this email directly or view it on GitHub:
#11 (comment)

from clj-json.

Related Issues (13)

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.