[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Wb-discuss] Performance numbers of WB on ESP32-S2
From: |
Lucian Popescu |
Subject: |
Re: [Wb-discuss] Performance numbers of WB on ESP32-S2 |
Date: |
Mon, 20 May 2024 16:33:20 +0300 |
I should have mentioned that I run the C/C++ version of wb-2b4.
On Mon, May 20, 2024 at 4:30 PM Lucian Popescu
<lucian.popescu187@gmail.com> wrote:
>
> Hi,
>
> I'm running WB on ESP32-S2 in a setup with 200K RAM and 32MB of flash.
> My goal is to store 100.000 8-byte random numbers in a b-tree stored
> on flash and run queries on the b-tree to check if a number exists in
> there.
>
> I did a performance test that bt_put's random numbers in the b-tree
> and measures the performance of bt_put. The code looks roughly like
> this:
>
> init_wb(0xd, 0xd, 0x80);
> SEGD *seg = make_seg("/littlefs/data.db", 0x80);
> HAND *han = create_db(seg, 'T', "data");
>
> for (int i = 0; i < 100000; i++) {
> struct timeval tv1, tv2;
> int len = 8; <-- this controls how many bytes are in the keys
> stored in the b-tree
> char b[len];
> esp_fill_random(b, len);
>
> gettimeofday(&tv1, NULL);
> bt_put(han, b, len, NULL, 0);
> gettimeofday(&tv2, NULL);
> ESP_LOGI(TAG, "bt_put perf: %lld", (tv2.tv_sec - tv1.tv_sec) *
> 1000000 + tv2.tv_usec - tv1.tv_usec);
> }
>
> The loop generates len random bytes that are stored in the b-tree. I
> used the following values for len in my tests: 1, 2, 4, 8. I did not
> let the loop run until the end because that would take a long time, I
> only tested for 2000 iterations then stopped it.
>
> The numbers are below:
> 1b
> Mean: 24968.83
> Standard Deviation: 37253.01
> 2b
> Mean: 158025.28
> Standard Deviation: 219210.12
> 4b
> Mean: 258114.24
> Standard Deviation: 341704.91
> 8b
> Mean: 404211.82
> Standard Deviation: 581779.47
>
> The durations are measured in microseconds.
>
> As I mentioned, my goal is to store 8-byte numbers, however 400ms +-
> 600ms for a bt_put is quite a big number. Is there anything I can do
> to reduce this number?
>
> I chose the minimum parameters for init_wb and make_seg to reduce as
> much as possible the memory footprint. My guess is that I need to
> somehow tweak these numbers, however it's not very clear how to do
> that.
>
> Another thing that should be mentioned is that I run WB over littlefs
> which runs over a W25Q256JVFIQ flash.
>
> Any help is welcomed.
>
> Thanks,
> Lucian