Skip to content

Commit 8b9610e

Browse files
committed
Fix minor issue with Moshi potentially not flushing content; disable lazy-maps optimization for jackson-jr
1 parent 92d3cd7 commit 8b9610e

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/main/java/com/cowtowncoder/jsonperf/dzone/read/DZoneReadPojoJacksonJr.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,11 @@ public class DZoneReadPojoJacksonJr extends DZoneReadTestBase<MeasurementPOJO>
1818

1919
public DZoneReadPojoJacksonJr()
2020
{
21-
json = JSON.std;
21+
json = JSON.std
22+
/* 01-Jun-2016, tatu: Should NOT use deferred maps as they can
23+
* skew results
24+
*/
25+
.without(JSON.Feature.USE_DEFERRED_MAPS);
2226
}
2327

2428
@Override

src/main/java/com/cowtowncoder/jsonperf/dzone/write/DZoneWriteMoshi.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ public int _writeItems(MeasurementPOJO items, OutputStream out) throws Exception
3434
{
3535
BufferedSink sink = Okio.buffer(Okio.sink(out));
3636
adapter.toJson(sink, items);
37+
sink.close();
3738
return items.size();
3839
}
3940

0 commit comments

Comments
 (0)