use of com.linkedin.data.codec.BsonDataCodec in project rest.li by linkedin.
the class TestData method testBsonStressBufferSizeDataCodec.
@Test
public void testBsonStressBufferSizeDataCodec() throws IOException {
for (int i = 16; i < 32; ++i) {
BsonDataCodec codec = new BsonDataCodec(i, true);
testDataCodec(codec);
}
}
use of com.linkedin.data.codec.BsonDataCodec in project rest.li by linkedin.
the class TestData method testBsonDataCodec.
/*
@Test
public void testBson4JacksonDataCodec() throws IOException
{
Bson4JacksonDataCodec codec = new Bson4JacksonDataCodec();
testDataCodec(codec);
}
*/
@Test
public void testBsonDataCodec() throws IOException {
BsonDataCodec codec = new BsonDataCodec();
testDataCodec(codec);
}
use of com.linkedin.data.codec.BsonDataCodec in project rest.li by linkedin.
the class TestData method perfTest.
private void perfTest(int count, DataMap map) throws IOException {
List<DataCodec> codecs = new ArrayList<DataCodec>();
codecs.add(new JacksonDataCodec());
//codecs.add(new Bson4JacksonDataCodec());
codecs.add(new BsonDataCodec());
for (DataCodec codec : codecs) {
byte[] bytes = codec.mapToBytes(map);
out.println(codec.getClass().getName() + " serialized size " + bytes.length);
}
for (DataCodec codec : codecs) {
dataMapToBytesPerfTest(count, codec, map);
}
for (DataCodec codec : codecs) {
byte[] bytes = codec.mapToBytes(map);
bytesToDataMapPerfTest(count, codec, bytes);
}
}
Aggregations