Fork me on GitHub
#transit
<
2022-12-09
>
bringe18:12:39

Hello. We discovered with a work project recently that sending edn for a particular http response (at least), was significantly faster than sending transit-json. I previously expected the opposite. To avoid repeating the conversation, here’s a link to it: https://clojurians.slack.com/archives/C0E1SN0NM/p1670456849355409. You can see we ran some tests to verify this. The conclusion (a guess) is that for certain kinds of data or data types, edn is faster than transit, OR there is just something we are misunderstanding, or an assumption we’ve made about this that isn’t true. Any idea why edn is faster for us?

p-himik19:12:57

It would be nice to have a proper test-case, where you measure all times separately - serialization, sending, deserialization (in a browser, not in CLJ; or maybe in CLJ in addition to in a browser).

bringe22:12:45

Well we’ve narrowed it down to being related to the cljs and not the clj by hitting the endpoint in the backend repl with clj-http. I think the time to call and parse in the clj was something like a 5th of the time it took to call from the cljs and parse.

bringe23:12:49

Beyond that I’m not sure we’re going to do much more investigating due to having other priorities and the fact that we know we’re getting a ~30-40% increase in performance by using EDN. I think for now we’re only using EDN for that one response. If we dig more I can report back.