Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kvdb 存储读取速度变慢 #311

Open
penghongquan opened this issue Sep 9, 2024 · 2 comments
Open

kvdb 存储读取速度变慢 #311

penghongquan opened this issue Sep 9, 2024 · 2 comments

Comments

@penghongquan
Copy link

我给 kvdb 分配了 500k 空间来保存一个结构体(有且仅有这一个 key 需要保存),分别使用
fdb_kv_get_blob(&kvdb, "charge_device_info", fdb_blob_make(&blob, (void*)&charge_device_info.boot_count, OFFSET_STRUCT(DEVICE_INFO_T, time))); 读取结构体数据
fdb_kv_set_blob(&kvdb, "charge_device_info", fdb_blob_make(&blob, (void*)&charge_device_info.boot_count, OFFSET_STRUCT(DEVICE_INFO_T, time))); 保存结构体数据
我测试 1s 保存一次(实际使用是每 10 分钟保存一次,长供电),一段时间之后,保存一次时间越来越慢,现在需要 15s 才能执行完一次存储,请教下我需要怎么做才能缩短储存时间

@littlewhitezkz
Copy link

分区太大了吧,其实我也被这个性能测试搞得摸不着头脑。

@armink
Copy link
Owner

armink commented Oct 16, 2024

有没有试试分区小一点呢,分区太大,脏数据过多,确实每次遍历的时间会加倍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants