2014-09-05 4:18 GMT-03:00 Sven Van Caekenberghe <sven@stfx.eu>:
On 04 Sep 2014, at 21:43, Esteban A. Maringolo <emaringolo@gmail.com> wrote:
Even though I don't use PharoExtras/JSON for my daily JSON manipulation (I use Seaside-JSON and NeoJSON), I found it to be the most "modular"/"independent" JSON package out there.
I don't see how the JSON and NeoJSON package differ in that respect. NeoJSON has no dependencies. Could you explain this point ?
My Bad, I didn't mean exactly that. When I wrote the above paragraph I thought NeoJSON required the specification of a schema and couldn't simply convert JSON strings to Dictionaries. The only thing I like about PharoExtras/JSON is the fact JsonObject allows its direct manipulation without having to use dictionary accessors, but still allowing for it (because JsonObject IS a Dictionary). We can perfectly replace it by NeoJSON. Mine was a proof of concept, which once I debugged through a lot types of PGPacket ended up being simpler than thought. Supporting parametrized statements with JSON is something I would like to check (I guess it is only text). Adding support to jsonb type is linear too on the client side, just replicate what I did for json. I did a quick benchmark comparing JSON parsers and NeoJSON gets slightly faster as the stream gets larger. I didn't profile them memorywise. 31bytes JSON: NeoJSON: 73,600 per second. JSON: 42,700 per second. WAJsonParser: 79,400 per second. 309bytes JSON: NeoJSON: 14,200 per second. JSON: 12,400 per second. WAJsonParser: 13,900 per second. 17215bytes JSON: NeoJSON: 277 per second. JSON: 194 per second. WAJsonParser: 255 per second. https://gist.github.com/eMaringolo/5e7c865188036faa7202#file-json-bench