siara-cc / esp32_arduino_sqlite3_lib

Sqlite3 Arduino library for ESP32
Apache License 2.0
350 stars 66 forks source link

slow execution of sqlite3_step() function?! #33

Open GithubPatrick91 opened 3 years ago

GithubPatrick91 commented 3 years ago

I have some performance problem with the step() method of sqlite3. i would like to insert a std::vector (size 250) of these struct: struct DATA{ pair<int, byte> id; pair<int, byte> value; pair<string, byte> s_timestamp; };

but all in all takes around >4500ms. the "slow" part is the sqlite3_step() function, which already takes 15-25ms (for each row).

i used prepared_v2(), bind() statements and Begin/End Transaction too.

Its running on a ESP32 at 240MHz. Is there any other method i could try?

siara-cc commented 3 years ago

What is the underlying file system? It is usually that. 15-25 ms could be normal. It depends on the speed of the file system, the speed of the interface (example SPI), number of data lines and few other things.