A fast JSON serializer
Remi Forax
forax at univ-mlv.fr
Thu Sep 15 19:42:25 UTC 2016
> De: "John Rose" <john.r.rose at oracle.com>
> À: "Da Vinci Machine Project" <mlvm-dev at openjdk.java.net>
> Envoyé: Jeudi 15 Septembre 2016 21:02:14
> Objet: Re: A fast JSON serializer
> On Sep 14, 2016, at 3:03 PM, Remi Forax < forax at univ-mlv.fr > wrote:
>> Another idea from the JVM Summit,
>> because the JDK9 now uses fast string concatenation by default, a JSON
>> serializer based on reflection can be outperformed by a hand written code.
>> The following code is a small JSON serializer that use the StringConcatFactory
>> of JDK9
>> https://gist.github.com/forax/76124b69631475105f87ddd2205a4d91
> Very cute. Lots of ideas in there. Cool use of permuteArgs. And a MIC!
doing the update the of inlining cache at the end is not that difficult
BTW, a student of mine will do an update of the JSR 292 cookbook as his master thesis later this year. the hope to clean the dirt and add new patterns.
> Doesn't handle strings with quotes or escapes, but that's easy to fix if you
> don't care about performance of that case.
i've thunk a little about that, the idea was that the user has to declare that the string need escaping using a field of the annotation JSONProperty.
> Re-entrance detection is too strict, I think; looks like it would fail if the
> Car had a Wheel.
doh, sorry, i botch that, i've updated the code with a version that should work :)
> You could build a templating engine by factoring out the middle parts of it.
> That could then be used to create the JSON dumper.
with the restriction that you can not have more than 255 holes in the template :)
> — John
Rémi
> _______________________________________________
> mlvm-dev mailing list
> mlvm-dev at openjdk.java.net
> http://mail.openjdk.java.net/mailman/listinfo/mlvm-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/mlvm-dev/attachments/20160915/d6ed770a/attachment.html>
More information about the mlvm-dev
mailing list