Comments (5)
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.
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.
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.
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.
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)
- How to use additional data types? HOT 2
- keyword namespaces
- Lazy parsing isn't too useful in its current form HOT 1
- 'lein javac' results in java.lang.NoSuchMethodError: org.apache.tools.ant.launch.Locator.fromJarURI HOT 1
- Failed compile-java HOT 4
- Something wrong with v0.5.2 HOT 7
- clj_json/JsonExt : Unsupported major.minor version 51.0 HOT 3
- Doesn't handle escaping non-ASCII?
- Doesn't like literals: #uuid and #inst HOT 1
- java.lang.UnsupportedClassVersionError: clj_json/JsonExt HOT 1
- Naming conventions HOT 1
- Keywords in parsed maps HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from clj-json.