正做一个在嵌入式linux中使用sqlite数据库的项目,
一使用sqlite的API接口函数 CPU占用率就大,200多M的主频,占用率差不多10%左右
请问这样正常吗
------解决方案--------------------
不正常,你调用sqlite接口的时候,在做什么事情?
可以打开统计功能,看看sqlite到底在做什么,如下所示:
sqlite3开启统计功能:
sqlite> .stats on
sqlite> select * from test;
1
------解决方案--------------------
a
------解决方案--------------------
2
------解决方案--------------------
a
------解决方案--------------------
cc
2
------解决方案--------------------
a
------解决方案--------------------
cc
2
------解决方案--------------------
a
------解决方案--------------------
cc
Memory Used: 86496 (max 103488) bytes
Number of Outstanding Allocations: 122 (max 159)
Number of Pcache Overflow Bytes: 8160 (max 12752) bytes
Number of Scratch Overflow Bytes: 0 (max 0) bytes
Largest Allocation: 64000 bytes
Largest Pcache Allocation: 1272 bytes
Largest Scratch Allocation: 0 bytes
Lookaside Slots Used: 11 (max 108)
Successful lookaside attempts: 1386
Lookaside failures due to size: 216
Lookaside failures due to OOM: 0
Pager Heap Usage: 8640 bytes
Page cache hits: 2
Page cache misses: 0
Page cache writes: 0
Schema Heap Usage: 2912 bytes
Statement Heap/Lookaside Usage: 2920 bytes
Fullscan Steps: 3
Sort Operations: 0
Autoindex Inserts: 0
Virtual Machine Steps: 28
sqlite>