SQLite.NET提供程式的選擇
今日用到了SQLite,發現這個資料庫進行了很大的升級,從3.4.X升級到3.5.X了。版本號發生改變,API介面OS層發生重大改變。
SQLite version 3.5.0 introduces a new OS interface layer that is incompatible with all prior versions of SQLite. In addition, a few existing interfaces have been generalized to work across all database connections within a process rather than just all connections within a thread. The purpose of this article is to describe the changes to 3.5.0 in detail so that users of prior versions of SQLite can judge what, if any, effort will be required to upgrade to newer versions.
1.0 Overview Of Changes
A quick enumeration of the changes in SQLite version 3.5.0 is provide here. Subsequent sections will describe these changes in more detail.
- The OS interface layer has been completely reworked:
- The undocumented sqlite3_os_switch() interface has been removed.
- The SQLITE_ENABLE_REDEF_IO compile-time flag no longer functions. I/O procedures are now always redefinable.
- Three new objects are defined for specifying I/O procedures: sqlite3_vfs, sqlite3_file, and sqlite3_io_methods.
- Three new interfaces are used to create alternative OS interfaces: sqlite3_vfs_register(), sqlite3_vfs_unregister(), and sqlite3_vfs_find().
- A new interface has been added to provided additional control over the creation of new database connections: sqlite3_open_v2(). The legacy interfaces of sqlite3_open() and sqlite3_open16() continue to be fully supported.
- The optional shared cache and memory management features that were introduced in version 3.3.0 can now be used across multiple threads within the same process. Formerly, these extensions only applied to database connections operating within a single thread.
- The sqlite3_enable_shared_cache() interface now applies to all threads within a process, not to just the one thread in which it was run.
- The sqlite3_soft_heap_limit() interface now applies to all threads within a process, not to just the one thread in which it was run.
- The sqlite3_release_memory() interface will now attempt to reduce the memory usages across all database connections in all threads, not just connections in the thread where the interface is called.
- The sqlite3_thread_cleanup() interface has become a no-op.
- Restrictions on the use of the same database connection by multiple threads have been dropped. It is now safe for multiple threads to use the same database connection at the same time.
- There is now a compile-time option that allows an application to define alternative malloc()/free() implementations without having to modify any core SQLite code.
- There is now a compile-time option that allows an application to define alternative mutex implementations without having to modify any core SQLite code.
Of these changes, only 1a and 2a through 2c are incompatibilities in any formal sense. But users who have previously made custom modifications to the SQLite source (for example to add a custom OS layer for embedded hardware) might find that these changes have a larger impact. On the other hand, an important goal of these changes is to make it much easier to customize SQLite for use on different operating systems.
由於儲存層的改變,SQLite.NET的各個版本也發生了變化:
SQLite.NET 1.0.46是最後一個基於3.4.X版本的提供程式;
SQLite.NET 1.0.48是當前最新的基於3.5.4程式碼的提供程式;
SQLite.NET的新版本主要是隨SQLite3.4->3.5的改進而進行了相應的修改。效能有很大變化,對比如下:
1.0.46 test Beginning Test on System.Data.SQLite.SQLiteConnection Inserting using CommandBuilder and DataAdapter Inserting using CommandBuilder and DataAdapter Fast insert using parameters and prepared statement User Function iteration of 120003 records in 240 ms User (text) command executed 397517 times in 1 second. UserAggregate executed 17 times in 1 second. SUCCESS - UserCollation Tests Finished. |
1.0.48 test Beginning Test on System.Data.SQLite.SQLiteConnection Inserting using CommandBuilder and DataAdapter Inserting using CommandBuilder and DataAdapter Fast insert using parameters and prepared statement User Function iteration of 120003 records in 191 ms User (text) command executed 298951 times in 1 second. UserAggregate executed 15 times in 1 second. SUCCESS - UserCollation Tests Finished. |
由測試可知,3.4版的SQLite在很多方面,效能依然要比3.5版的SQLite強不少。但是SQLite 3.5版在OS適配層的改進(引入VFS物件),提高了資料的寫入效率,明顯的,其Commits的時間總是較少。
結論:
3.4版的SQLite在資料插入較多的應用情況下,效率仍然較好;
3.5版的SQLite在資料寫入磁碟方面有很大改進,但其顯然在記憶體資料組織方面還有待改進,插入操作所耗費的時間明顯比3.4版要長;
感覺3.4版的SQLite是非常穩定的一個版本。3.5版,看來等等再使用了。
本文轉自斯克迪亞部落格園部落格,原文連結:http://www.cnblogs.com/sgsoft/archive/2008/02/19/1074055.html,如需轉載請自行聯絡原作者
相關文章
- 如何選擇最適合您的代理提供商?
- 選擇郵件營銷平臺的關鍵要素:為中小企業提供絕佳選擇
- 小程式開發選擇公司等於選擇人
- 程式設計師:選擇效率,還是選擇質量?程式設計師
- wpf winform 選擇檔案或選擇資料夾程式碼ORM
- 探究:初學者程式語言的選擇
- 家屬感言:選擇程式設計師,就是選擇一種生活程式設計師
- 如何選擇大資料的程式語言大資料
- 如何選擇適合自己的程式語言
- 程式設計師職業之路的選擇程式設計師
- 程式語言的異同及選擇 (轉)
- 002---選擇器(標籤選擇器、類選擇器、id選擇器、偽類選擇器、萬用字元選擇器)字元
- 微軟的選擇微軟
- 為什麼說選擇正確的程式語言很重要,以及如何正確的選擇
- 為什麼說選擇正確的程式語言很重要 以及如何正確的選擇
- jQuery選擇器介紹:基本選擇器、層次選擇器、過濾選擇器、表單選擇器jQuery
- Kilimall選擇亞馬遜雲科技為首選雲服務提供商,擴充非洲電商業務亞馬遜
- 施耐德電氣選擇亞馬遜雲科技作為首選雲和機器學習服務提供商亞馬遜機器學習
- jQuery操作checkbox選擇程式碼jQuery
- 程式流程 (順序,選擇,迴圈)
- jQuery選擇器——基本選擇器jQuery
- js選擇物件和jq選擇物件的區別JS物件
- 擼個微信小程式的省市區選擇器微信小程式
- 如何選擇適合你的程式碼風格?
- 如何選擇你的第一門程式語言
- 程式設計師跳槽的最佳時機選擇程式設計師
- 程式碼的清晰和簡潔之間的選擇
- 基本CSS選擇器,複合選擇器,後代選擇器CSS
- JQuery選擇器——可見性篩選選擇器和屬性篩選選擇器jQuery
- 挑戰程式設計競賽選讀-選擇排序程式設計排序
- 禁用文字選擇、右鍵選單例項程式碼單例
- DOM元素的選擇
- Jquery的選擇器jQuery
- CSS的選擇器CSS
- go的選擇UIGoUI
- jQuery選擇器——層次選擇器jQuery
- 選擇優化選項的方案優化
- 【恩墨學院】DBMS_FILE_TRANSFER為ASM的檔案傳輸提供了新的選擇ASM