Re: [ClojureScript] Re: [ANN] Longshi a ClojureScript port of Fressian

2014-08-04 Thread David Nolen
On Mon, Aug 4, 2014 at 10:51 AM, Francis Avila fav...@breezeehr.com wrote: I've looked closely at utf-8 encoders/decoders in JS vs TextEncoder, and I'm not sure fast string encoding/decoding alone is going to bring us the kind of speed improvements we need to make binary formats a clear win

Re: [ClojureScript] Re: [ANN] Longshi a ClojureScript port of Fressian

2014-08-04 Thread Francis Avila
The difference in performance between native and non-native string encoding (using the fastest js implementations I can manage to write, granted) is at most 2x to 3x, which is certainly an improvement but not enough to overcome the approximately order-of-magnitude difference in overall encoding

Re: [ClojureScript] Re: [ANN] Longshi a ClojureScript port of Fressian

2014-08-04 Thread Francis Avila
I thought MessagePack js implementations were quite a bit slower than 4-5x. Do you know of any benchmarks? String encoding/decoding is definitely big part of the slowdown, not disagreeing. MessagePack doesn't even have a string type: I think it's only convention that their raw type contains utf-8

Re: [ClojureScript] Re: [ANN] Longshi a ClojureScript port of Fressian

2014-08-04 Thread David Nolen
I looked at various things on jsperf like http://jsperf.com/json-bson-msgpack/2 and ran the benchmarks for https://github.com/pgriess/node-msgpack on my machine. David On Mon, Aug 4, 2014 at 11:56 AM, Francis Avila fav...@breezeehr.com wrote: I thought MessagePack js implementations were quite

Re: [ClojureScript] Re: [ANN] Longshi a ClojureScript port of Fressian

2014-08-03 Thread Peter Schuck
Fressian's caching strategy is very flexible and powerful but doesn't have a lot of documetnation. I view Fressian's caching as similar to memory references for Clojure values. You can cache any value no matter how large and once the value is cached referencing it again is only a few bytes.

Re: [ClojureScript] Re: [ANN] Longshi a ClojureScript port of Fressian

2014-08-03 Thread David Nolen
RE: writing/reading strings I wonder if this won't help https://plus.google.com/+AddyOsmani/posts/4GgX9CD6c1X? David On Sun, Aug 3, 2014 at 9:51 AM, Peter Schuck pe...@bendyworks.com wrote: Fressian's caching strategy is very flexible and powerful but doesn't have a lot of documetnation. I

[ClojureScript] Re: [ANN] Longshi a ClojureScript port of Fressian

2014-08-02 Thread Alex Miller
Cool stuff Peter. It would be interesting to compare performance with transit-cljs https://github.com/cognitect/transit-cljs. Transit has the same caching and extensibility benefits of Fressian but leverages the very fast JavaScript parser capabilities built into the browser, so is likely

Re: [ClojureScript] Re: [ANN] Longshi a ClojureScript port of Fressian

2014-08-02 Thread Sean Grove
I thought transit's caching only applied to map keys? Pretty unclear on what Fressian's can do On Sat, Aug 2, 2014 at 8:23 AM, Alex Miller a...@puredanger.com wrote: Cool stuff Peter. It would be interesting to compare performance with transit-cljs https://github.com/cognitect/transit-cljs.

Re: [ClojureScript] Re: [ANN] Longshi a ClojureScript port of Fressian

2014-08-02 Thread David Nolen
In Transit, maps keys, symbols, keywords, and tagged value tags are subject to caching. Fressian's caching strategy is far more flexible from what I understand. That said transit-cljs is 20-30X faster than cljs.reader/read-string on the benchmarks I've tried across various browser and command

Re: [ClojureScript] Re: [ANN] Longshi a ClojureScript port of Fressian

2014-08-02 Thread Alex Miller
I took significant structural similarity to primarily mean at least maps with similar keys, which Transit caching will cover. On Sat, Aug 2, 2014 at 1:49 PM, David Nolen dnolen.li...@gmail.com wrote: In Transit, maps keys, symbols, keywords, and tagged value tags are subject to caching.