sqlite_orm icon indicating copy to clipboard operation
sqlite_orm copied to clipboard

Speed, IWHat I am doing wrong

Open marriusco opened this issue 3 years ago • 2 comments

This is on Linux Ubuntu 20.xx 4 cores (Intel(R) Core(TM) i7-7500U CPU @ 2.70GHz bogomips : 5799.7) 192 inserts / second looks slow. How can I accelerate this. I would need around 4K/sec.

` auto storage = make_storage("name.db", ExperimetInfoTbl::mkt() ); storage.sync_schema(); ExperimetInfoTbl t; t.experiment_id=1; t.machine="ggg"; t.material="mmm"; t.number=66; t.part=4; t.sensor=0; t.used=1; t.success=false; time_t cct = time(0) + 10; while(::time(0) < cct) { t.experiment_id++; storage.insert(t); } std::cout << t.experiment_id<< "\n";

shell

linux$ ./dbtest 1930 # in 10 seconds therefore 193 inserts /second, this looks slow. `

marriusco avatar Jun 01 '22 23:06 marriusco

hi. It is not related to sqlite_orm, it is related to SQLite itself. So don't expect you'll get the best help here for sure. But let me try to help: add storage.begin_transaction() right before while and storage.commit() right after while

fnc12 avatar Jun 03 '22 04:06 fnc12

@marriusco did it work?

fnc12 avatar Jun 12 '22 03:06 fnc12

closing due to inactivity

fnc12 avatar Oct 08 '23 13:10 fnc12