private void putData(final AbstractLmdbDb<Integer, String> db,
                         final int iterations,
                         final int rounds,
                         final boolean isOrdered,
                         final boolean deleteBetweenRounds) {

        final LmdbEnv lmdbEnv = db.getLmdbEnvironment();
        int round = 0;
        final List<Entry<Integer, String>> inputData = new ArrayList<>(iterations);

        while (round < rounds) {
            inputData.clear();
            for (int i = 0; i < iterations; i++) {
                inputData.add(Map.entry(i + ((int) iterations * round), "value-" + i));
            }

            if (!isOrdered) {
                // Shuffle the data and put the keys in random order
                Collections.shuffle(inputData);
            }

            // Put the ordered keys in MDB_APPEND mode
            DurationTimer timer = DurationTimer.start();
            putValues(db, false, isOrdered, inputData);
            timer.stop();
            double bytesPerEntry = lmdbEnv.getSizeOnDisk() / (double) db.getEntryCount();
            LOGGER.info("{} puts,    size on disk: {}, bytes/entry: {}, time: {}, entry count: {}",
                    ModelStringUtil.formatCsv(iterations),
                    ByteSize.ofBytes(lmdbEnv.getSizeOnDisk()),
                    bytesPerEntry,
                    timer,
                    ModelStringUtil.formatCsv(db.getEntryCount()));

            if (deleteBetweenRounds) {
                timer = DurationTimer.start();
                deleteValues(db, inputData);
                timer.stop();
                LOGGER.info("{} deletes, size on disk: {}, bytes/entry: {}, time: {}, entry count: {}",
                        ModelStringUtil.formatCsv(iterations),
                        ByteSize.ofBytes(lmdbEnv.getSizeOnDisk()),
                        bytesPerEntry,
                        timer,
                        ModelStringUtil.formatCsv(db.getEntryCount()));
            }
            round++;
        }
    }
Compare using MDB_APPEND with and without MDB_INTEGERKEY, deleting entries
as we go
stroom-lmdb/src/test/java/stroom/lmdb/TestLmdbPerformance.java