Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Genson benchmarks #1

Open
m0mus opened this issue Sep 30, 2016 · 2 comments
Open

Add Genson benchmarks #1

m0mus opened this issue Sep 30, 2016 · 2 comments

Comments

@m0mus
Copy link
Owner

m0mus commented Sep 30, 2016

The goal is to compare JSONB-RI with Jackson, Genson and Gson. Each benchmark test has to be created for all these frameworks with cold and warm engine. Cold means that the engine is created in the test and warm means that the engine creation and initialization is not a part of test.

This task is about adding Genson framework to the project and add Genson benchmarks for all current tests.

@pedes
Copy link
Contributor

pedes commented Oct 3, 2016

I would like to handle this task, and it would be great to have another task for the analysis/comparison with Jackson.

We could tackle the tasks, one by one. What does "engine" refers?

@m0mus
Copy link
Owner Author

m0mus commented Oct 3, 2016

"Engine" is a main class you call serialize and deserialize methods on. For JSON-B it's Jsonb class. The purpose of splitting to "cold" and "warm" is to know how long it takes to initialize the engine for this particular use case.

Here is a "cold" test:

JsonbConfig config = new JsonbConfig()
        .withFormatting(true)
        .withAdapters(new AnimalAdapter());
Jsonb jsonb = JsonbBuilder.create(config);

Type animalsListType = new ArrayList<Animal>() {}.getClass().getGenericSuperclass();
String result = jsonb.toJson(animals, animalsListType);

And the "warm" test is just this:

String result = jsonb.toJson(animals, animalsListType);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants