On Sep 14, 2016, at 3:03 PM, Remi Forax <fo...@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 
> <https://gist.github.com/forax/76124b69631475105f87ddd2205a4d91>

Very cute.  Lots of ideas in there.  Cool use of permuteArgs.  And a MIC!

Doesn't handle strings with quotes or escapes, but that's easy to fix if you 
don't care about performance of that case.

Re-entrance detection is too strict, I think; looks like it would fail if the 
Car had a Wheel.

You could build a templating engine by factoring out the middle parts of it.  
That could then be used to create the JSON dumper.

— John
mlvm-dev mailing list

Reply via email to