Memory fragmentation affect sqlite3 performance -
i have following sequence in application.
download contacts mobile phone using bluetooth's pbap.
writing these contacts custom database created sqlite. configured sqlite zero-malloc option , given 1mb buffer use heap, , using other optimizations row insertions in single transaction,
pragma journal_mode = memory,pragma synchronous = off,pragma count_changes = off.after writing database reading contacts database , creating speech pronunciations contact names. speech pronunciation algorithm using dynamic memory allocations too-much.
now, if repeat above 3 steps, 3 times in sequence in single execution getting following results.
1st time : contacts downloaded in 5 sec, database created in 10 sec.
2nd time : contacts downloaded in 5 sec, database created in 60 sec.
3rd time : contacts downloaded in 5 sec, database created in 500 sec.
now removed speech pronunciation creation app , repeated 3 times again. result
1st time : contacts downloaded in 5 sec, database created in 10 sec.
2nd time : contacts downloaded in 5 sec, database created in 10 sec.
3rd time : contacts downloaded in 5 sec, database created in 10 sec.
i found issue pronunciation creation, memory got fragmented while creating pronunciations , affected performance of sqlite next time onwards.
but, configured heap sqlite , enabled memsys5, fragmentation affected.
please give suggestion solve issue.
Comments
Post a Comment