Search in sources :

Example 1 with Page

use of rpc.turbo.benchmark.bean.Page in project turbo-rpc by hank-whu.

the class ProtostuffBenchmark method deserializeUserPage.

@Benchmark
@BenchmarkMode({ Mode.Throughput })
@OutputTimeUnit(TimeUnit.MILLISECONDS)
@SuppressWarnings("unchecked")
public Page<User> deserializeUserPage() throws Exception {
    listBuffer.readerIndex(0);
    ByteBufInput input = new ByteBufInput(listBuffer, true);
    Page<User> userPage = (Page<User>) userPageSchema.newMessage();
    userPageSchema.mergeFrom(input, userPage);
    return userPage;
}
Also used : User(rpc.turbo.benchmark.bean.User) ByteBufInput(io.protostuff.ByteBufInput) Page(rpc.turbo.benchmark.bean.Page) BenchmarkMode(org.openjdk.jmh.annotations.BenchmarkMode) Benchmark(org.openjdk.jmh.annotations.Benchmark) OutputTimeUnit(org.openjdk.jmh.annotations.OutputTimeUnit)

Aggregations

ByteBufInput (io.protostuff.ByteBufInput)1 Benchmark (org.openjdk.jmh.annotations.Benchmark)1 BenchmarkMode (org.openjdk.jmh.annotations.BenchmarkMode)1 OutputTimeUnit (org.openjdk.jmh.annotations.OutputTimeUnit)1 Page (rpc.turbo.benchmark.bean.Page)1 User (rpc.turbo.benchmark.bean.User)1