[英]How to improve performance on SQLite3 iPhone program
I am (still) working on an iPhone program which uses SQLite3. 我(仍)在使用SQLite3的iPhone程序上工作。 I have managed to optimize the database writes as far as I can. 我已尽力优化数据库写入。
The problem I have now is that "END TRANSACTION" is killing me as it's taking very long. 我现在遇到的问题是,“ END TRANSACTION”正在杀死我,因为这花费了很长时间。 The journal file is usually about 50k which might be a problem, but I'd like to know your ideas. 日志文件通常约为50k,这可能是个问题,但我想知道您的想法。
I tried using "PRAGMA synchronous = 0", but that caused some data corruption. 我尝试使用“ PRAGMA同步= 0”,但是这导致了一些数据损坏。 My latest attempt at optimizing is "PRAGMA journal_mode=TRUNCATE" but I do not know if that helps a lot. 我最近的优化尝试是“ PRAGMA journal_mode = TRUNCATE”,但我不知道这是否有很大帮助。
Any suggestions at this stage? 在这个阶段有什么建议吗?
Have you tried the in memory journaling? 您是否尝试过内存日志?
"PRAGMA journal_mode=MEMORY" “ PRAGMA journal_mode = MEMORY”
That was one of the most significant performance boosts for us. 这对我们而言是最重要的性能提升。
If that is not quite fast enough yet, try the memsys5 stuff. 如果那还不够快,请尝试使用memsys5。 http://www.sqlite.org/compile.html#enable_memsys5 http://www.sqlite.org/compile.html#enable_memsys5
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.