-
Notifications
You must be signed in to change notification settings - Fork 754
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
关于写入速度 #57
Comments
补充一下LOG ,可以看到 写一个时长要3s多 [16:43:38.726]收←◆Flash Trigger a GC check after created ENV. [16:43:38.936]收←◆Flash The remain empty sector is 948, GC threshold is 1. [16:44:13.166]收←◆Flash The remain empty sector is 948, GC threshold is 1. [16:44:47.525]收←◆Flash The remain empty sector is 948, GC threshold is 1. |
会不会跟 SPI 驱动有关系,先抓一下 SPI 波形分析一下吧 |
这个SPI驱动和之前 直接驱动flash是同一个驱动,是直接的hal库 api; |
另外一个发现,随着写入次数的增加,写入的速度越来越慢 |
是否有相关的测试benchmark? |
4.0 在减少 RAM 占用的条件下牺牲了环境变量操作的速度,如果对速度要求苛刻,可以先使用 3.0 版本。 接下来会对 4.0 的速度问题重点优化,如果兴趣欢迎加入进来一起优化。 |
我调试了一下发现,每次都会执行如下代码,检测 所有env,这里消耗大部分时间 ENV 缓存在ram中还是有必要 |
建议用类型文件系统中的INODE ,维护一张表用来映射数据的地址;alios things 有类型的 K - V storage 机制,不知是不是参考你的项目,本想移植alios 但依赖其本身系统太多,不太好移植 |
嗯,这个是一个优化点,你可以先改下试试。 |
hi, @TeemoRZ ,最新的版本新加入了缓存机制,查找、写入效率提升非常明显,你可以试试哈~~ |
@TeemoRZ 请问这个问题你解决了吗?我也发现这里遍历时特别慢。大约50个env, 需要600ms。我已经用cache feature了。 |
无论写入多大的数据,延时都大于2s,尝试修改retry_delay_100us 有所减少,但还是很慢?是否有对应的数据呢》
MCU:STM32F105RCT6
FREQUENCE:72MHZ
FLASH CHIP:W25Q128
移植的读写接口如下:
static sfud_err spi_write_read(const sfud_spi *spi, const uint8_t *write_buf, size_t write_size, uint8_t *read_buf,
size_t read_size) {
sfud_err result = SFUD_SUCCESS;
uint8_t send_data, read_data;
int i = 0;
spi_user_data_t spi_dev = (spi_user_data_t) spi->user_data;
}
The text was updated successfully, but these errors were encountered: