SlideShare a Scribd company logo
1 of 28
Java JSON Parser
Benchmarks
Rick Hightower
• Java Boon - Benchmarks
• Boon comes with a fast JSON parser. This parser
was forked / merged into Groovy 2.3. The Boon and
Groovy 2.3 JSON parsers are a lot faster than
mainstream JSON parsers.
• "Rick / Andrey duo spent a fair amount of time
optimizing our JSON support, making Groovy
2.3’s JSON support usually faster than all the
JSON libraries available in the Java ecosystem."
-- Guillaume Laforge
How much faster?
Benchmark uses JMH
• JMH is what OpenJDK uses
• We used json files from json.org for parsing
Environment
• Environment
• OSX MacBook Pro, JDK 1.7, 16GB RAM and
512GB SSD drive
Summary
• Jackson is consistently faster than GSON and JSONSmart.
• Boon JSON parser is faster than Jackson with Reader, reading files, byte[],
and char[] and String.
• Boon is 3x to 5x faster than Jackson at parsing JSON from String and char[],
and 2x to 4x faster at parsing byte[]
• Boon and Jackson speeds are much closer with InputStream based parsing.
Boon is usually faster at InputStream, but the margins are much smaller.
• Boon and Jackson are close at handling InputStream if the JSON stream is
small. Once the JSON stream gets over 1KB to 2KB, Boon wins consistently.
• Boon is faster at encoding JSON strings, and serializing/de-serializing Java
instances to/from JSON than Jackson.
FAQ 1
• Why don't you test GSON and JSONSmart?Jackson
is faster than GSON and JSONSmart. We have
tests for all four. We only included the tests for
Jackson because Jackson is faster than the other
two. Anyone can download the benchmark and run
all of the tests.
FAQ 2
• Why don't you test Jackson AST?
• We do. We see no real difference between readTree
and readValue. We left out AST because it is
redundant. The tests are still there and easy to run.
AST +/- 10% of non AST usually +/- 5%.
Who wrote benchmarks?
• Who wrote the benchmarks?
• They first version was written by Stephane
Landelle of Gatling fame and performance expert
• Later they were added to by Andrey Bloschetsov
for Groovy serialization
• Rick Hightower added new tests as well
Relationship to Groovy
JSON parser for 2.3?
• Andrey Bloschetsov and Rick Hightower, with the help of the Groovy lead
developers, took the Boon classes mostly written by Hightower and forked
them into Groovy 2.3
• Mainly for parsing, but we also improved the JSON serialization speed
• Boon and Groovy parsing are unsurprisingly very comparable
• Groovy JSON parsing is a bit faster in a few use cases, and Boon parser is
a bit faster in a few uses cases, but mostly they are neck in neck
• Boon JSON de-serialization (from JSON into instances of Classes) is still
quite a bit faster than Groovy. This will change in Groovy 2.4 or 2.5
• The new Groovy JSON parser based on Boon is 20x faster than the Groovy
2.2 parser
Are the benchmarks flawed and do
they allow JIT dead code elimination?
• Unlikely
• The benchmark uses JMH. JMH is what the
OpenJDK uses for benchmarking. JMH endeavors
to eliminate JIT dead code elimination.
• See full benchmarks here
(https://github.com/RichardHightower/json-parsers-
benchmark/blob/master/README.md)
11
JMH BlackHole
JMH BlackHole
Allows no DEAD CODE JIT
ELIMINATION
Running JMH
• For most tests parser are warmed up after two
JMH runs. For some tests Jackson needed a few
more warmups and it was accommodated with
extra warmup time
Boon JSON Caveats
• Boon JSON parser is a parser optimized for REST and WebSocket style services.
• Boon JSON parser is optimized to work in a reactive style environment like
Akka, Vert.x, etc. Boon JSON parser would work well with MessageDrivenBeans (EJB or
Spring).
• For some use cases it runs stateless faster than Jackson runs with shared buffers.
• Jackson can handle very large JSON files and very large JSON streams. This support was
added to Boon JSON as part of the fork/port to Groovy JSON. With larger files the speeds
are much more equivalent, and in fact Jackson might be 10% faster or so.
• Benchmark first.
• It would take some extra effort to get superior results in a Servlet environment (it can be
done).
• Jackson is mature and solid. Don't assume ripping out Jackson for Boon will buy you
anything. Jackson has tooling that makes it work really well in a Java EE environment, and
is more fool proof.
JSON from Files
JSON from InputStream
Object Serialization
• Java Boon and Jackson are faster than Java
ObjectOutputStream and ObjectInputStream
• Java Boon is 85% of the speed of Kryo which is the
fastest binary serializer
• Boon JSON support is also really good at doing
weird JSON encoding.
• Why Boon?
• Easily read in files into lines or a giant string with one
method call. Works with files, URLs, class-path, etc. Boon
IO support will surprise you how easy it is. Boon has Slice
notation for dealing with Strings, Lists, primitive
arrays, Tree Maps, etc. If you are from Groovy land, Ruby
land, Python land, or whatever land, and you have to use
Java then Boon might give you some relief from API
bloat. If you are like me, and you like to use Java, then
Boon is for you too. Boon lets Java be Java, but adds the
missing productive APIs from Python, Ruby, and Groovy.
Boon may not be Ruby or Groovy, but its a real Boon to
Java development.
Why Faster?
Why Faster? Continued

More Related Content

What's hot

Drupal meets PostgreSQL for DrupalCamp MSK 2014
Drupal meets PostgreSQL for DrupalCamp MSK 2014Drupal meets PostgreSQL for DrupalCamp MSK 2014
Drupal meets PostgreSQL for DrupalCamp MSK 2014Kate Marshalkina
 
Apache Any23 - Anything to Triples
Apache Any23 - Anything to TriplesApache Any23 - Anything to Triples
Apache Any23 - Anything to TriplesMichele Mostarda
 
Keyword-Based Navigation and Search over the Linked Data Web
Keyword-Based Navigation and Search over the Linked Data WebKeyword-Based Navigation and Search over the Linked Data Web
Keyword-Based Navigation and Search over the Linked Data WebLuca Matteis
 
Dcm#8 elastic search
Dcm#8  elastic searchDcm#8  elastic search
Dcm#8 elastic searchIvan Wallarm
 
PostgreSQL - It's kind've a nifty database
PostgreSQL - It's kind've a nifty databasePostgreSQL - It's kind've a nifty database
PostgreSQL - It's kind've a nifty databaseBarry Jones
 
Search and analyze your data with elasticsearch
Search and analyze your data with elasticsearchSearch and analyze your data with elasticsearch
Search and analyze your data with elasticsearchAnton Udovychenko
 
Growing an ecosystem on the JVM
Growing an ecosystem on the JVMGrowing an ecosystem on the JVM
Growing an ecosystem on the JVMIulian Dragos
 
EUC2015 - Load testing XMPP servers with Plain Old Erlang
EUC2015 - Load testing XMPP servers with Plain Old ErlangEUC2015 - Load testing XMPP servers with Plain Old Erlang
EUC2015 - Load testing XMPP servers with Plain Old ErlangPaweł Pikuła
 
NoSQL, no SQL injections?
NoSQL, no SQL injections?NoSQL, no SQL injections?
NoSQL, no SQL injections?Wayne Huang
 
PHP, the GraphQL ecosystem and GraphQLite
PHP, the GraphQL ecosystem and GraphQLitePHP, the GraphQL ecosystem and GraphQLite
PHP, the GraphQL ecosystem and GraphQLiteJEAN-GUILLAUME DUJARDIN
 
New thing in JDK10 even that scala-er should know
New thing in JDK10 even that scala-er should knowNew thing in JDK10 even that scala-er should know
New thing in JDK10 even that scala-er should knowなおき きしだ
 
Carlo Sciolla - Above and beyond type systems with clojure.spec - Codemotion ...
Carlo Sciolla - Above and beyond type systems with clojure.spec - Codemotion ...Carlo Sciolla - Above and beyond type systems with clojure.spec - Codemotion ...
Carlo Sciolla - Above and beyond type systems with clojure.spec - Codemotion ...Codemotion
 
FunctionalConf '16 Robert Virding Erlang Ecosystem
FunctionalConf '16 Robert Virding Erlang EcosystemFunctionalConf '16 Robert Virding Erlang Ecosystem
FunctionalConf '16 Robert Virding Erlang EcosystemRobert Virding
 

What's hot (19)

Drupal meets PostgreSQL for DrupalCamp MSK 2014
Drupal meets PostgreSQL for DrupalCamp MSK 2014Drupal meets PostgreSQL for DrupalCamp MSK 2014
Drupal meets PostgreSQL for DrupalCamp MSK 2014
 
SOLR
SOLRSOLR
SOLR
 
Apache Any23 - Anything to Triples
Apache Any23 - Anything to TriplesApache Any23 - Anything to Triples
Apache Any23 - Anything to Triples
 
Keyword-Based Navigation and Search over the Linked Data Web
Keyword-Based Navigation and Search over the Linked Data WebKeyword-Based Navigation and Search over the Linked Data Web
Keyword-Based Navigation and Search over the Linked Data Web
 
Json
JsonJson
Json
 
Dcm#8 elastic search
Dcm#8  elastic searchDcm#8  elastic search
Dcm#8 elastic search
 
PostgreSQL - It's kind've a nifty database
PostgreSQL - It's kind've a nifty databasePostgreSQL - It's kind've a nifty database
PostgreSQL - It's kind've a nifty database
 
Search and analyze your data with elasticsearch
Search and analyze your data with elasticsearchSearch and analyze your data with elasticsearch
Search and analyze your data with elasticsearch
 
Growing an ecosystem on the JVM
Growing an ecosystem on the JVMGrowing an ecosystem on the JVM
Growing an ecosystem on the JVM
 
Apache Jackrabbit
Apache JackrabbitApache Jackrabbit
Apache Jackrabbit
 
EUC2015 - Load testing XMPP servers with Plain Old Erlang
EUC2015 - Load testing XMPP servers with Plain Old ErlangEUC2015 - Load testing XMPP servers with Plain Old Erlang
EUC2015 - Load testing XMPP servers with Plain Old Erlang
 
Scalable Open Source
Scalable Open SourceScalable Open Source
Scalable Open Source
 
NoSQL, no SQL injections?
NoSQL, no SQL injections?NoSQL, no SQL injections?
NoSQL, no SQL injections?
 
PHP, the GraphQL ecosystem and GraphQLite
PHP, the GraphQL ecosystem and GraphQLitePHP, the GraphQL ecosystem and GraphQLite
PHP, the GraphQL ecosystem and GraphQLite
 
Jakarta EE 8 on JDK17
Jakarta EE 8 on JDK17Jakarta EE 8 on JDK17
Jakarta EE 8 on JDK17
 
New thing in JDK10 even that scala-er should know
New thing in JDK10 even that scala-er should knowNew thing in JDK10 even that scala-er should know
New thing in JDK10 even that scala-er should know
 
Json
JsonJson
Json
 
Carlo Sciolla - Above and beyond type systems with clojure.spec - Codemotion ...
Carlo Sciolla - Above and beyond type systems with clojure.spec - Codemotion ...Carlo Sciolla - Above and beyond type systems with clojure.spec - Codemotion ...
Carlo Sciolla - Above and beyond type systems with clojure.spec - Codemotion ...
 
FunctionalConf '16 Robert Virding Erlang Ecosystem
FunctionalConf '16 Robert Virding Erlang EcosystemFunctionalConf '16 Robert Virding Erlang Ecosystem
FunctionalConf '16 Robert Virding Erlang Ecosystem
 

Similar to Java JSON Benchmark

Ups and downs of enterprise Java app in a research setting
Ups and downs of enterprise Java app in a research settingUps and downs of enterprise Java app in a research setting
Ups and downs of enterprise Java app in a research settingCsaba Toth
 
Serialization and performance in Java
Serialization and performance in JavaSerialization and performance in Java
Serialization and performance in JavaStrannik_2013
 
Сергей Моренец. Serialization and performance in Java
Сергей Моренец. Serialization and performance in JavaСергей Моренец. Serialization and performance in Java
Сергей Моренец. Serialization and performance in JavaVolha Banadyseva
 
JParse Fast JSON Parser
JParse Fast JSON ParserJParse Fast JSON Parser
JParse Fast JSON ParserRick Hightower
 
MongoDB revs you up: What Storage Engine is Right for You?
MongoDB revs you up: What Storage Engine is Right for You?MongoDB revs you up: What Storage Engine is Right for You?
MongoDB revs you up: What Storage Engine is Right for You?Jonathan E. Tobin
 
Spring Framework 5.0: Hidden Gems
Spring Framework 5.0: Hidden GemsSpring Framework 5.0: Hidden Gems
Spring Framework 5.0: Hidden GemsVMware Tanzu
 
GoLang - Why It Matters
GoLang -  Why It MattersGoLang -  Why It Matters
GoLang - Why It Mattersrahul
 
Google Protocol Buffers + gRPC
Google Protocol Buffers + gRPCGoogle Protocol Buffers + gRPC
Google Protocol Buffers + gRPCImal hasaranga
 
Introduction of Java GC Tuning and Java Java Mission Control
Introduction of Java GC Tuning and Java Java Mission ControlIntroduction of Java GC Tuning and Java Java Mission Control
Introduction of Java GC Tuning and Java Java Mission ControlLeon Chen
 
Groovy best pratices at EWAY
Groovy best pratices at EWAYGroovy best pratices at EWAY
Groovy best pratices at EWAYĐào Hiệp
 
What’s new in JSR 367 Java API for JSON Binding
What’s new in JSR 367 Java API for JSON BindingWhat’s new in JSR 367 Java API for JSON Binding
What’s new in JSR 367 Java API for JSON BindingDmitry Kornilov
 
Performance and Abstractions
Performance and AbstractionsPerformance and Abstractions
Performance and AbstractionsMetosin Oy
 
Is Groovy better for testing than Java?
Is Groovy better for testing than Java?Is Groovy better for testing than Java?
Is Groovy better for testing than Java?Trisha Gee
 
Jruby a Pi and a database
Jruby a Pi and a databaseJruby a Pi and a database
Jruby a Pi and a databasePhilipp Fehre
 
Scala Json Features and Performance
Scala Json Features and PerformanceScala Json Features and Performance
Scala Json Features and PerformanceJohn Nestor
 
Messaging, interoperability and log aggregation - a new framework
Messaging, interoperability and log aggregation - a new frameworkMessaging, interoperability and log aggregation - a new framework
Messaging, interoperability and log aggregation - a new frameworkTomas Doran
 
Fun with EJB 3.1 and Open EJB
Fun with EJB 3.1 and Open EJBFun with EJB 3.1 and Open EJB
Fun with EJB 3.1 and Open EJBArun Gupta
 
Scaling a MeteorJS SaaS app on AWS
Scaling a MeteorJS SaaS app on AWSScaling a MeteorJS SaaS app on AWS
Scaling a MeteorJS SaaS app on AWSBrett McLain
 

Similar to Java JSON Benchmark (20)

Ups and downs of enterprise Java app in a research setting
Ups and downs of enterprise Java app in a research settingUps and downs of enterprise Java app in a research setting
Ups and downs of enterprise Java app in a research setting
 
Serialization and performance in Java
Serialization and performance in JavaSerialization and performance in Java
Serialization and performance in Java
 
Сергей Моренец. Serialization and performance in Java
Сергей Моренец. Serialization and performance in JavaСергей Моренец. Serialization and performance in Java
Сергей Моренец. Serialization and performance in Java
 
JParse Fast JSON Parser
JParse Fast JSON ParserJParse Fast JSON Parser
JParse Fast JSON Parser
 
MongoDB revs you up: What Storage Engine is Right for You?
MongoDB revs you up: What Storage Engine is Right for You?MongoDB revs you up: What Storage Engine is Right for You?
MongoDB revs you up: What Storage Engine is Right for You?
 
Spring Framework 5.0: Hidden Gems
Spring Framework 5.0: Hidden GemsSpring Framework 5.0: Hidden Gems
Spring Framework 5.0: Hidden Gems
 
GoLang - Why It Matters
GoLang -  Why It MattersGoLang -  Why It Matters
GoLang - Why It Matters
 
Google Protocol Buffers + gRPC
Google Protocol Buffers + gRPCGoogle Protocol Buffers + gRPC
Google Protocol Buffers + gRPC
 
Introduction of Java GC Tuning and Java Java Mission Control
Introduction of Java GC Tuning and Java Java Mission ControlIntroduction of Java GC Tuning and Java Java Mission Control
Introduction of Java GC Tuning and Java Java Mission Control
 
Groovy best pratices at EWAY
Groovy best pratices at EWAYGroovy best pratices at EWAY
Groovy best pratices at EWAY
 
What’s new in JSR 367 Java API for JSON Binding
What’s new in JSR 367 Java API for JSON BindingWhat’s new in JSR 367 Java API for JSON Binding
What’s new in JSR 367 Java API for JSON Binding
 
Performance and Abstractions
Performance and AbstractionsPerformance and Abstractions
Performance and Abstractions
 
Is Groovy better for testing than Java?
Is Groovy better for testing than Java?Is Groovy better for testing than Java?
Is Groovy better for testing than Java?
 
Jruby a Pi and a database
Jruby a Pi and a databaseJruby a Pi and a database
Jruby a Pi and a database
 
Scala Json Features and Performance
Scala Json Features and PerformanceScala Json Features and Performance
Scala Json Features and Performance
 
Jcp adopt jsr
Jcp adopt jsrJcp adopt jsr
Jcp adopt jsr
 
Messaging, interoperability and log aggregation - a new framework
Messaging, interoperability and log aggregation - a new frameworkMessaging, interoperability and log aggregation - a new framework
Messaging, interoperability and log aggregation - a new framework
 
Fun with EJB 3.1 and Open EJB
Fun with EJB 3.1 and Open EJBFun with EJB 3.1 and Open EJB
Fun with EJB 3.1 and Open EJB
 
Zero mq logs
Zero mq logsZero mq logs
Zero mq logs
 
Scaling a MeteorJS SaaS app on AWS
Scaling a MeteorJS SaaS app on AWSScaling a MeteorJS SaaS app on AWS
Scaling a MeteorJS SaaS app on AWS
 

More from Rick Hightower

Service Mesh Talk for CTO Forum
Service Mesh Talk for CTO ForumService Mesh Talk for CTO Forum
Service Mesh Talk for CTO ForumRick Hightower
 
Service Mesh CTO Forum (Draft 3)
Service Mesh CTO Forum (Draft 3)Service Mesh CTO Forum (Draft 3)
Service Mesh CTO Forum (Draft 3)Rick Hightower
 
Accelerate Delivery: Business Case for Agile DevOps, CI/CD and Microservices
Accelerate Delivery: Business Case for Agile DevOps, CI/CD and MicroservicesAccelerate Delivery: Business Case for Agile DevOps, CI/CD and Microservices
Accelerate Delivery: Business Case for Agile DevOps, CI/CD and MicroservicesRick Hightower
 
Accelerate Delivery: Business case for Agile DevOps, CI/CD and Microservices
Accelerate Delivery: Business case for Agile DevOps, CI/CD and MicroservicesAccelerate Delivery: Business case for Agile DevOps, CI/CD and Microservices
Accelerate Delivery: Business case for Agile DevOps, CI/CD and MicroservicesRick Hightower
 
Accelerate DevOps/Microservices and Kubernetes
Accelerate DevOps/Microservices and KubernetesAccelerate DevOps/Microservices and Kubernetes
Accelerate DevOps/Microservices and KubernetesRick Hightower
 
Accelerate using DevOps and CI/CD.
Accelerate using DevOps and CI/CD.Accelerate using DevOps and CI/CD.
Accelerate using DevOps and CI/CD.Rick Hightower
 
High-speed, Reactive Microservices 2017
High-speed, Reactive Microservices 2017High-speed, Reactive Microservices 2017
High-speed, Reactive Microservices 2017Rick Hightower
 
Reactive Java: Promises and Streams with Reakt (JavaOne Talk 2016)
Reactive Java:  Promises and Streams with Reakt (JavaOne Talk 2016)Reactive Java:  Promises and Streams with Reakt (JavaOne Talk 2016)
Reactive Java: Promises and Streams with Reakt (JavaOne Talk 2016)Rick Hightower
 
Reactive Java: Promises and Streams with Reakt (JavaOne talk 2016)
Reactive Java: Promises and Streams with Reakt  (JavaOne talk 2016)Reactive Java: Promises and Streams with Reakt  (JavaOne talk 2016)
Reactive Java: Promises and Streams with Reakt (JavaOne talk 2016)Rick Hightower
 
High-Speed Reactive Microservices - trials and tribulations
High-Speed Reactive Microservices - trials and tribulationsHigh-Speed Reactive Microservices - trials and tribulations
High-Speed Reactive Microservices - trials and tribulationsRick Hightower
 
High-Speed Reactive Microservices
High-Speed Reactive MicroservicesHigh-Speed Reactive Microservices
High-Speed Reactive MicroservicesRick Hightower
 
Netty Notes Part 3 - Channel Pipeline and EventLoops
Netty Notes Part 3 - Channel Pipeline and EventLoopsNetty Notes Part 3 - Channel Pipeline and EventLoops
Netty Notes Part 3 - Channel Pipeline and EventLoopsRick Hightower
 
Netty Notes Part 2 - Transports and Buffers
Netty Notes Part 2 - Transports and BuffersNetty Notes Part 2 - Transports and Buffers
Netty Notes Part 2 - Transports and BuffersRick Hightower
 
WebSocket MicroService vs. REST Microservice
WebSocket MicroService vs. REST MicroserviceWebSocket MicroService vs. REST Microservice
WebSocket MicroService vs. REST MicroserviceRick Hightower
 
Consul: Microservice Enabling Microservices and Reactive Programming
Consul: Microservice Enabling Microservices and Reactive ProgrammingConsul: Microservice Enabling Microservices and Reactive Programming
Consul: Microservice Enabling Microservices and Reactive ProgrammingRick Hightower
 
The Java Microservice Library
The Java Microservice LibraryThe Java Microservice Library
The Java Microservice LibraryRick Hightower
 
MongoDB quickstart for Java, PHP, and Python developers
MongoDB quickstart for Java, PHP, and Python developersMongoDB quickstart for Java, PHP, and Python developers
MongoDB quickstart for Java, PHP, and Python developersRick Hightower
 
Mongo DB for Java, Python and PHP Developers
Mongo DB for Java, Python and PHP DevelopersMongo DB for Java, Python and PHP Developers
Mongo DB for Java, Python and PHP DevelopersRick Hightower
 

More from Rick Hightower (19)

Service Mesh Talk for CTO Forum
Service Mesh Talk for CTO ForumService Mesh Talk for CTO Forum
Service Mesh Talk for CTO Forum
 
Service Mesh CTO Forum (Draft 3)
Service Mesh CTO Forum (Draft 3)Service Mesh CTO Forum (Draft 3)
Service Mesh CTO Forum (Draft 3)
 
Accelerate Delivery: Business Case for Agile DevOps, CI/CD and Microservices
Accelerate Delivery: Business Case for Agile DevOps, CI/CD and MicroservicesAccelerate Delivery: Business Case for Agile DevOps, CI/CD and Microservices
Accelerate Delivery: Business Case for Agile DevOps, CI/CD and Microservices
 
Accelerate Delivery: Business case for Agile DevOps, CI/CD and Microservices
Accelerate Delivery: Business case for Agile DevOps, CI/CD and MicroservicesAccelerate Delivery: Business case for Agile DevOps, CI/CD and Microservices
Accelerate Delivery: Business case for Agile DevOps, CI/CD and Microservices
 
Accelerate DevOps/Microservices and Kubernetes
Accelerate DevOps/Microservices and KubernetesAccelerate DevOps/Microservices and Kubernetes
Accelerate DevOps/Microservices and Kubernetes
 
Accelerate using DevOps and CI/CD.
Accelerate using DevOps and CI/CD.Accelerate using DevOps and CI/CD.
Accelerate using DevOps and CI/CD.
 
High-speed, Reactive Microservices 2017
High-speed, Reactive Microservices 2017High-speed, Reactive Microservices 2017
High-speed, Reactive Microservices 2017
 
Reactive Java: Promises and Streams with Reakt (JavaOne Talk 2016)
Reactive Java:  Promises and Streams with Reakt (JavaOne Talk 2016)Reactive Java:  Promises and Streams with Reakt (JavaOne Talk 2016)
Reactive Java: Promises and Streams with Reakt (JavaOne Talk 2016)
 
Reactive Java: Promises and Streams with Reakt (JavaOne talk 2016)
Reactive Java: Promises and Streams with Reakt  (JavaOne talk 2016)Reactive Java: Promises and Streams with Reakt  (JavaOne talk 2016)
Reactive Java: Promises and Streams with Reakt (JavaOne talk 2016)
 
High-Speed Reactive Microservices - trials and tribulations
High-Speed Reactive Microservices - trials and tribulationsHigh-Speed Reactive Microservices - trials and tribulations
High-Speed Reactive Microservices - trials and tribulations
 
High-Speed Reactive Microservices
High-Speed Reactive MicroservicesHigh-Speed Reactive Microservices
High-Speed Reactive Microservices
 
Netty Notes Part 3 - Channel Pipeline and EventLoops
Netty Notes Part 3 - Channel Pipeline and EventLoopsNetty Notes Part 3 - Channel Pipeline and EventLoops
Netty Notes Part 3 - Channel Pipeline and EventLoops
 
Netty Notes Part 2 - Transports and Buffers
Netty Notes Part 2 - Transports and BuffersNetty Notes Part 2 - Transports and Buffers
Netty Notes Part 2 - Transports and Buffers
 
Notes on Netty baics
Notes on Netty baicsNotes on Netty baics
Notes on Netty baics
 
WebSocket MicroService vs. REST Microservice
WebSocket MicroService vs. REST MicroserviceWebSocket MicroService vs. REST Microservice
WebSocket MicroService vs. REST Microservice
 
Consul: Microservice Enabling Microservices and Reactive Programming
Consul: Microservice Enabling Microservices and Reactive ProgrammingConsul: Microservice Enabling Microservices and Reactive Programming
Consul: Microservice Enabling Microservices and Reactive Programming
 
The Java Microservice Library
The Java Microservice LibraryThe Java Microservice Library
The Java Microservice Library
 
MongoDB quickstart for Java, PHP, and Python developers
MongoDB quickstart for Java, PHP, and Python developersMongoDB quickstart for Java, PHP, and Python developers
MongoDB quickstart for Java, PHP, and Python developers
 
Mongo DB for Java, Python and PHP Developers
Mongo DB for Java, Python and PHP DevelopersMongo DB for Java, Python and PHP Developers
Mongo DB for Java, Python and PHP Developers
 

Recently uploaded

Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 

Recently uploaded (20)

Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 

Java JSON Benchmark

  • 2. • Java Boon - Benchmarks • Boon comes with a fast JSON parser. This parser was forked / merged into Groovy 2.3. The Boon and Groovy 2.3 JSON parsers are a lot faster than mainstream JSON parsers. • "Rick / Andrey duo spent a fair amount of time optimizing our JSON support, making Groovy 2.3’s JSON support usually faster than all the JSON libraries available in the Java ecosystem." -- Guillaume Laforge
  • 4. Benchmark uses JMH • JMH is what OpenJDK uses • We used json files from json.org for parsing
  • 5. Environment • Environment • OSX MacBook Pro, JDK 1.7, 16GB RAM and 512GB SSD drive
  • 6. Summary • Jackson is consistently faster than GSON and JSONSmart. • Boon JSON parser is faster than Jackson with Reader, reading files, byte[], and char[] and String. • Boon is 3x to 5x faster than Jackson at parsing JSON from String and char[], and 2x to 4x faster at parsing byte[] • Boon and Jackson speeds are much closer with InputStream based parsing. Boon is usually faster at InputStream, but the margins are much smaller. • Boon and Jackson are close at handling InputStream if the JSON stream is small. Once the JSON stream gets over 1KB to 2KB, Boon wins consistently. • Boon is faster at encoding JSON strings, and serializing/de-serializing Java instances to/from JSON than Jackson.
  • 7. FAQ 1 • Why don't you test GSON and JSONSmart?Jackson is faster than GSON and JSONSmart. We have tests for all four. We only included the tests for Jackson because Jackson is faster than the other two. Anyone can download the benchmark and run all of the tests.
  • 8. FAQ 2 • Why don't you test Jackson AST? • We do. We see no real difference between readTree and readValue. We left out AST because it is redundant. The tests are still there and easy to run. AST +/- 10% of non AST usually +/- 5%.
  • 9. Who wrote benchmarks? • Who wrote the benchmarks? • They first version was written by Stephane Landelle of Gatling fame and performance expert • Later they were added to by Andrey Bloschetsov for Groovy serialization • Rick Hightower added new tests as well
  • 10. Relationship to Groovy JSON parser for 2.3? • Andrey Bloschetsov and Rick Hightower, with the help of the Groovy lead developers, took the Boon classes mostly written by Hightower and forked them into Groovy 2.3 • Mainly for parsing, but we also improved the JSON serialization speed • Boon and Groovy parsing are unsurprisingly very comparable • Groovy JSON parsing is a bit faster in a few use cases, and Boon parser is a bit faster in a few uses cases, but mostly they are neck in neck • Boon JSON de-serialization (from JSON into instances of Classes) is still quite a bit faster than Groovy. This will change in Groovy 2.4 or 2.5 • The new Groovy JSON parser based on Boon is 20x faster than the Groovy 2.2 parser
  • 11. Are the benchmarks flawed and do they allow JIT dead code elimination? • Unlikely • The benchmark uses JMH. JMH is what the OpenJDK uses for benchmarking. JMH endeavors to eliminate JIT dead code elimination. • See full benchmarks here (https://github.com/RichardHightower/json-parsers- benchmark/blob/master/README.md) 11
  • 14. Allows no DEAD CODE JIT ELIMINATION
  • 15. Running JMH • For most tests parser are warmed up after two JMH runs. For some tests Jackson needed a few more warmups and it was accommodated with extra warmup time
  • 16. Boon JSON Caveats • Boon JSON parser is a parser optimized for REST and WebSocket style services. • Boon JSON parser is optimized to work in a reactive style environment like Akka, Vert.x, etc. Boon JSON parser would work well with MessageDrivenBeans (EJB or Spring). • For some use cases it runs stateless faster than Jackson runs with shared buffers. • Jackson can handle very large JSON files and very large JSON streams. This support was added to Boon JSON as part of the fork/port to Groovy JSON. With larger files the speeds are much more equivalent, and in fact Jackson might be 10% faster or so. • Benchmark first. • It would take some extra effort to get superior results in a Servlet environment (it can be done). • Jackson is mature and solid. Don't assume ripping out Jackson for Boon will buy you anything. Jackson has tooling that makes it work really well in a Java EE environment, and is more fool proof.
  • 19.
  • 20.
  • 21.
  • 22. Object Serialization • Java Boon and Jackson are faster than Java ObjectOutputStream and ObjectInputStream • Java Boon is 85% of the speed of Kryo which is the fastest binary serializer
  • 23.
  • 24. • Boon JSON support is also really good at doing weird JSON encoding.
  • 25.
  • 26. • Why Boon? • Easily read in files into lines or a giant string with one method call. Works with files, URLs, class-path, etc. Boon IO support will surprise you how easy it is. Boon has Slice notation for dealing with Strings, Lists, primitive arrays, Tree Maps, etc. If you are from Groovy land, Ruby land, Python land, or whatever land, and you have to use Java then Boon might give you some relief from API bloat. If you are like me, and you like to use Java, then Boon is for you too. Boon lets Java be Java, but adds the missing productive APIs from Python, Ruby, and Groovy. Boon may not be Ruby or Groovy, but its a real Boon to Java development.