Posts

Showing posts with the label json

Blogger JSON Feed API

Image
Blogger JSON Feed API Maybe sometimes we need a widget for certain features, but the widgets are not available. Blogger already provides an APIs to overcome this, so we can create our own widget by reading the blog feed using the JSON and JavaScript. Here is the JSON feed API: Object Description Example json.feed.id.$t Show blog ID tag:blogger.com,1999:blog-12345 json.feed.updated.$t Last update of a blog 2013-07-08T18:21:57.051+07:00 json.feed.category[] Categories / label array of a blog json.feed.category[i].term Show the i-th category Blogger json.feed.title.$t Show blog name Next72 json.feed.subtitle.$t Show description of a blog Maxs Weblog json.feed.author[] Array of blog authors Danang Probo Sayekti, Matt Cutts json.feed.author[i].name.$t Show the i-th blog author name Danang Pobo Sayekti json.feed.author[i].uri.$t Show the i-th profile author uri https://profiles.google.com/123456789 json.feed.openSearch$totalResults.$t Show total posts 777 json.feed.entry[] Posts array of a b...

Boon JSON sersialization versus Kryo binary serialization versus Java Object Serialization

Boon JSON sersialization versus Kryo binary serialization versus Java Object Serialization Kryo vs. Boon v. Java Object Serialization Boon is not just a fast JSON parser, it happens to be one of the fastest ways to do Java Object Serialization period. Boon Java JSON serialization is faster than Java Object Serialization (ObjectOutputStream). It just happens to work with JSON. Kryo, a binary serializer which is the fastest way to serialize Java objects, wins by the way, but for large streams, Boon gets within 85% of Kryo. To get Java JSON serialization within 15% of the fastest Java Binary serializer took quite some effort. Boon JSON serialization is probably in the top five Java serializers for speed, and it is the fastest way to do JSON.?  Benchmark Mode Thr Count Sec Mean Mean error Units i.g.j.s.MainBoonSerializer.roundTripBig thrpt 16 6 1 101.078 12.809 ops/s i.g.j.s.MainJavaSerialization.roundTripBig thrpt 16 6 1 90.572 10.920 ops/s i.g.j.s.MainKryoJavaSerialization.roundTripB...

Boon JSON parser 1 7 MB JSON String against all competitors

Boon JSON parser 1 7 MB JSON String against all competitors Boon does not come with just one JSON parser. Boon comes with many, and now so does Groovy. There is the Boon JSON classic parser which does not use index overlay. Lets see how Boon and Groovy stack up to the competitors. This time I am going to throw in a few more of the Boon JSON parsers. This is parsing a 1.7 MB JSON string. Why didnt I cover each type of parser in the last benchmark....  Because it is boring. I just picked the best one for the benchmark. But there are parsers that are geared toward certain use cases.  Operations per second. Benchmark                                           Mode   Thr     Count  Sec    Mean        Mean error     StatelessBoonBenchMark.citmCatalog              ...

Boon JSON Custom object serializer now works with super classes and interfaces Example of using Guava HashCode

Boon JSON Custom object serializer now works with super classes and interfaces Example of using Guava HashCode related to https://github.com/RichardHightower/boon/issues/242 https://github.com/RichardHightower/boon/issues/231 Boon JSON: Custom object serializer works with super classes, and interfaces (and example of using HashCodeGuava).  Lets say you want to write a custom object serializer to work with Guava HashCode thingy or whatever else you need. public static String toJson ( Object obj ) { return createSerializer (). serialize ( obj ). toString (); } private static JsonSerializer createSerializer () { JsonSerializerFactory factory = new JsonSerializerFactory () . addTypeSerializer ( HashCode . class , new HashCodeSerializer () ); return factory . create (); } private static class HashCodeSerializer implements CustomObjectSerializer < HashCode > { @Override public Class < HashCode > type () { return HashCode . class ; } @...