private LocalFileMeta doSnapshotSave(final String path, final boolean isSstSnapshot, final boolean isFastSnapshot) {
        final String snapshotPath = Paths.get(path, SNAPSHOT_DIR).toString();
        try {
            final long saveStart = System.nanoTime();
            LocalFileMeta.Builder metaBuilder = null;
            if (isSstSnapshot) {
                doSstSnapshotSave(snapshotPath);
            } else {
                if (isFastSnapshot) {
                    metaBuilder = doFastSnapshotSave(snapshotPath);
                } else {
                    metaBuilder = doSlowSnapshotSave(snapshotPath);
                }
            }
            metaBuilder = metaBuilder == null ? LocalFileMeta.newBuilder() : metaBuilder;
            final String name;
            if (isSstSnapshot) {
                name = "sst";
            } else {
                if (isFastSnapshot) {
                    name = "fast";
                } else {
                    name = "slow";
                }
            }
            System.out.println(name + " save snapshot time cost: "
                               + TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - saveStart));
            final long compressStart = System.nanoTime();
            doCompressSnapshot(path, metaBuilder);
            System.out.println(name + " compressed file size: "
                               + FileUtils.sizeOf(Paths.get(path, SNAPSHOT_ARCHIVE).toFile()));
            System.out.println(name + " compress time cost: "
                               + TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - compressStart));
            return metaBuilder.build();
        } catch (final Throwable t) {
            t.printStackTrace();
        }
        return null;
    }
-----------------------------------------------
        db size = 10000000
        slow save snapshot time cost: 2552
        slow compressed file size: 41915298
        slow compress time cost: 9173
        slow load snapshot time cost: 5119
        -----------------------------------------------
        db size = 10000000
        fast save snapshot time cost: 524
        fast compressed file size: 41920248
        fast compress time cost: 8807
        fast load snapshot time cost: 3090
        -----------------------------------------------
        db size = 10000000
        sst save snapshot time cost: 4296
        sst compressed file size: 10741032
        sst compress time cost: 2005
        sst load snapshot time cost: 593
        -----------------------------------------------
        db size = 10000000
        slow save snapshot time cost: 2248
        slow compressed file size: 41918551
        slow compress time cost: 8705
        slow load snapshot time cost: 4485
        -----------------------------------------------
        db size = 10000000
        fast save snapshot time cost: 508
        fast compressed file size: 41914702
        fast compress time cost: 8736
        fast load snapshot time cost: 3047
        -----------------------------------------------
        db size = 10000000
        sst save snapshot time cost: 4206
        sst compressed file size: 10741032
        sst compress time cost: 1950
        sst load snapshot time cost: 599
        -----------------------------------------------
        db size = 10000000
        slow save snapshot time cost: 2327
        slow compressed file size: 41916640
        slow compress time cost: 8643
        slow load snapshot time cost: 4590
        -----------------------------------------------
        db size = 10000000
        fast save snapshot time cost: 511
        fast compressed file size: 41914533
        fast compress time cost: 8704
        fast load snapshot time cost: 3013
        -----------------------------------------------
        db size = 10000000
        sst save snapshot time cost: 4253
        sst compressed file size: 10741032
        sst compress time cost: 1947
        sst load snapshot time cost: 590
        -----------------------------------------------
jraft-rheakv/rheakv-core/src/test/java/com/alipay/sofa/jraft/rhea/benchmark/raw/SnapshotBenchmark.java