Skip to content

Commit e25ad24

Browse files
committed
Add basic map-read case for json-parse form https://github.com/mitchhentges/json-parse
1 parent c608d05 commit e25ad24

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ as well as some of newer Java JSON library options:
1515
* [Johnzon](http://johnzon.incubator.apache.org/)
1616
* pre-1.0, incubation release
1717
* [json-io](https://github.com/jdereg/json-io)
18+
* [json-parse](https://github.com/mitchhentges/json-parse)
1819
* [Moshi](https://github.com/square/moshi): Android-optimized lib (by some of GSON authors)
1920

2021
The criteria for inclusion here is that for a library to be included it should
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
package com.cowtowncoder.jsonperf.dzone.read;
2+
3+
import java.util.Map;
4+
import java.util.concurrent.TimeUnit;
5+
6+
import org.openjdk.jmh.annotations.OutputTimeUnit;
7+
import org.openjdk.jmh.annotations.Scope;
8+
import org.openjdk.jmh.annotations.State;
9+
10+
import ca.fuzzlesoft.JsonParse;
11+
12+
@State(Scope.Thread)
13+
@OutputTimeUnit(TimeUnit.SECONDS)
14+
public class DZoneReadMapJsonParse extends DZoneReadTestBase<Map<?,?>>
15+
{
16+
protected final JsonParse parse;
17+
18+
public DZoneReadMapJsonParse()
19+
{
20+
parse = new JsonParse();
21+
}
22+
23+
@Override
24+
public Map<?,?> _readItems(byte[] input) throws Exception {
25+
// 04-Jan-2016, tatu: Alas, this library provides no other input source abstraction,
26+
// so we need to do this...
27+
return _readItems(new String(input, "UTF-8"));
28+
}
29+
30+
@Override
31+
public Map<?,?> _readItems(String input) throws Exception {
32+
return parse.map(input);
33+
}
34+
}

0 commit comments

Comments
 (0)