SparseArrays 比HashMap更有效率。
如果不需要同步的话,ArrayList比Vector更有效率。
尽可能使用懒初始化 技术。
在sqlite相关操作中,最好使用
db.beginTransaction
SQLiteStatementstmt = db.compileStatement
然后调用
。。。。
stmt.clearBindings
stmt.bindString(
stmt.executeInsert
最后调用
db.setTransactionSuccessful
db.endTransaction
这种方式的使用,速度相对来说最快,性能很好。在取数据query时,只取所需要的信息。
本文介绍了几种提高软件开发效率的方法,包括使用SparseArrays替代HashMap、ArrayList优于Vector等数据结构选择建议;推荐采用懒初始化技术来优化资源利用;对于SQLite数据库操作,则通过beginTransaction及compileStatement等方法实现高性能的数据插入和查询。

被折叠的 条评论
为什么被折叠?



