I use 100K String . and just call readString.  Here is the simple code:

@Benchmark
public void deserial(BenchmarkState state) throws Exception {
    ByteArrayInputStream bin = new ByteArrayInputStream(state.bytes);
    Hessian2Input input = new Hessian2Input(bin);
    String deserialize = input.readString();
    Assert.assertEquals(state.str, deserialize);
}

public static void main(String[] args) throws RunnerException {
    Options options = new OptionsBuilder()
            .include(HessianLitePerfTest.class.getSimpleName())
            .include(Hessian4PerfTest.class.getSimpleName())
            .warmupIterations(10)
            .measurementIterations(30)
            .threads(10)
            .mode(Mode.Throughput)
            .timeUnit(TimeUnit.SECONDS)
            .forks(1)
            .build();

    new Runner(options).run();
}






2018-04-24 11:10 GMT+08:00 Ian Luo <ian....@gmail.com>:

> Hessian-lite is tailored from the original hessian in order to keep it
> lightweight. From your test, it looks hessian 4 performs much much better
> than hessian-lite and hessian 3. Would you mind to describe how you run the
> test, or even better, share us your test code? Then we will consider to
> upgrade to hessian 4 and deprecate hessian-lite.
>
> Thanks,
> -Ian.
>
>
> On Mon, Apr 23, 2018 at 8:01 PM, whanice <ywh....@gmail.com> wrote:
>
> > I made a simply performance test in my mac to messure hessian.
> > the result is
> >
> > Benchmark                      Mode  Cnt     Score     Error  Units
> > Hessian4PerfTest.deserial     thrpt   30  4068.415 ± 189.925  ops/s
> > HessianLitePerfTest.deserial  thrpt   30  1941.054 ±  77.005  ops/s
> >
> > We can see hessian4(4.0.37) performs much better than hessian-lite(3.2.2)
> > in deserialization.
> >
> > So here comes the question
> >
> >    - 1. What is the difference between hessian-lite(3.2.2) and hessian3?
> >    - 2. Can sync with hessian4?
> >
>

Reply via email to