First of all it is absolutely not aples-to-apples, and the fact of using 
BLOB sql type just makes the water more muddy. Now, You have to realize 
that database commit, won't write it (do mvstore commit), unless your 
WRITE_DELAY=0, 
and H2 will slow down.
If you want to somewhat mimic H2, dont issue  MVStore.commit(), because it 
has nothing to do with db commit.


On Wednesday, May 19, 2021 at 10:45:19 AM UTC-4 wburzyns wrote:

>
> Hi,
>
> I need some insight regarding the performance of MVStore persisted 
> transactional maps (used in a single-thread environment).
> I did some benchmarks with MVStore (using it the same way it's used in the 
> TestTransactionStore.java) and - to my great surprise - the performance is 
> worse than performance of H2 used in the same scenario (i.e. as a key-value 
> store).
>
> In MVStore I'm operating on a map declared as TransactionMap<Long, 
> byte[]>. In H2 I have DATA_TABLE(ID BIGINT NOT NULL PRIMARY KEY, DATA 
> BLOB). While inserts are 30-40% faster in case of MVStore, the commit 
> operation (i.e. Transaction.commit() vs SQL "COMMIT") is ~9x slower in case 
> of MVStore. 
>
> 1) I changed the way my MVStore is built to the same settings H2 is using, 
> but it didn't help:
>
> MVStore.Builder().fileName(mvStorePath).compress().autoCommitDisabled().autoCompactFillRate(90).pageSplitSize(65536).open()
>
> 2) I've walked with debugger through H2 row insertion and noticed that H2 
> is opening maps not via Transaction.openMap() but via 
> TransactionMap.getInstance(txn), however changing the MVStore benchmark 
> code accordingly did not improve my results at all.
>
> I don't understand how it is possible that H2 that uses MVStore as its 
> storage engine and adds a lot of other stuff on top of it (SQL) can be 
> faster than raw MVStore. Am I doing something wrong? If I don't, is there a 
> way I can mimic H2's way of using MVStore to improve commit performance?
>
>
> Thanks,
> wburzyns

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/h2-database/5115f64e-ec0d-4c5f-98a3-9200fd1900f8n%40googlegroups.com.

Reply via email to