今日用到了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.

  1. The OS interface layer has been completely reworked:

    1. The undocumented sqlite3_os_switch() interface has been removed.
    2. The SQLITE_ENABLE_REDEF_IO compile-time flag no longer functions. I/O procedures are now always redefinable.
    3. Three new objects are defined for specifying I/O procedures: sqlite3_vfs, sqlite3_file, and sqlite3_io_methods.
    4. Three new interfaces are used to create alternative OS interfaces: sqlite3_vfs_register(), sqlite3_vfs_unregister(), and sqlite3_vfs_find().
    5. 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.
  2. 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.
    1. 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.
    2. 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.
    3. 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.
    4. The sqlite3_thread_cleanup() interface has become a no-op.
  3. 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.
  4. 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.
  5. 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
SUCCESS - CreateTable
SUCCESS - Full Text Search
SUCCESS - DataType Test
SUCCESS - Dispose pattern test
SUCCESS - KeyInfo Fetch
SUCCESS - Transaction Enlistment
SUCCESS - Guid Test
SUCCESS - InsertTable
SUCCESS - VerifyInsert
SUCCESS - CoersionTest
SUCCESS - ParameterizedInsert
SUCCESS - BinaryInsert (using named parameter)
SUCCESS - VerifyBinaryData
SUCCESS - LockTest
SUCCESS - ParameterizedInsertMissingParams

Inserting using CommandBuilder and DataAdapter
          -> (10,000 rows) ...
          -> Insert Ends in 210 ms ... Commits in 481 ms

Inserting using CommandBuilder and DataAdapter
          ->(with identity fetch) (10,000 rows) ...
          -> Insert Ends in 300 ms ... Commits in 201 ms

Fast insert using parameters and prepared statement
          -> (100,000 rows) Begins ...
          -> Ends in 801 ms ... Commits in 441 ms

User Function iteration of 120003 records in 240 ms
          Raw iteration of 120003 records in 100 ms
          Intrinsic Function iteration of 120003 records in 70 ms

User (text)  command executed 397517 times in 1 second.
          UserFunction command executed 570342 times in 1 second.
          Intrinsic    command executed 932032 times in 1 second.
          Intrin (txt) command executed 747247 times in 1 second.
          Raw Value    command executed 1013199 times in 1 second.

UserAggregate executed 17 times in 1 second.

SUCCESS - UserCollation
SUCCESS - DropTable

Tests Finished.

1.0.48 test

Beginning Test on System.Data.SQLite.SQLiteConnection
SUCCESS - CreateTable
SUCCESS - Full Text Search
SUCCESS - DataType Test
SUCCESS - Dispose pattern test
SUCCESS - KeyInfo Fetch
SUCCESS - Transaction Enlistment
SUCCESS - Guid Test
SUCCESS - InsertTable
SUCCESS - VerifyInsert
SUCCESS - CoersionTest
SUCCESS - ParameterizedInsert
SUCCESS - BinaryInsert (using named parameter)
SUCCESS - VerifyBinaryData
SUCCESS - LockTest
SUCCESS - ParameterizedInsertMissingParams

Inserting using CommandBuilder and DataAdapter
          -> (10,000 rows) ...
          -> Insert Ends in 411 ms ... Commits in 100 ms

Inserting using CommandBuilder and DataAdapter
          ->(with identity fetch) (10,000 rows) ...
          -> Insert Ends in 440 ms ... Commits in 131 ms

Fast insert using parameters and prepared statement
          -> (100,000 rows) Begins ...
          -> Ends in 1312 ms ... Commits in 340 ms

User Function iteration of 120003 records in 191 ms
          Raw iteration of 120003 records in 130 ms
          Intrinsic Function iteration of 120003 records in 140 ms

User (text)  command executed 298951 times in 1 second.
          UserFunction command executed 418648 times in 1 second.
          Intrinsic    command executed 599105 times in 1 second.
          Intrin (txt) command executed 458549 times in 1 second.
          Raw Value    command executed 655652 times in 1 second.

UserAggregate executed 15 times in 1 second.

SUCCESS - UserCollation
SUCCESS - DropTable

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版,看来等等再使用了。

SQLite.NET提供程序的选择相关推荐

  1. System.Data.SQLite(SQLite ADO.NET 2.0的提供程序,已经包含Sqlite引擎)

    今天在研究其他的技术的时候,重新查看了一下Sqlite在.NET下的最新实现.结果发现这样一个好东西.下面把其首页的说明翻译如下: System.Data.SQLite 是一个原始SQLite的加强版 ...

  2. 视频会议 sdk 选择_企业业务的十大热门视频通话和视频会议API / SDK提供程序

    视频会议 sdk 选择 Statista.com Statista.com Video conferencing App / Country Hangouts Meet Houseparty Ms T ...

  3. 仔细选择会话状态提供程序

    ASP.NET 为存储应用程序的会话数据提供了三种不同的方法:进程内会话状态.作为 Windows 服务的进程外会话状态和 SQL Server 数据库中的进程外会话状态.每种方法都有自己的优点,但进 ...

  4. Android内容提供程序

    内容提供程序管理对结构化数据集的访问,它们封装数据,并供用于定义数据安全性的机制.内容提供程序是连接一个进程中的数据与另一个进程中运行的代码的标准界面. 将应用的Context中的ContentRes ...

  5. 连接Oracle错误:800a0e7a未找到提供程序的解决

    一.现象: C#程序中需要以Provider=OraOLEDB.Oracle.1方式访问ORACLE数据库.但程序执行时报异常:未在本地计算机注册"OraOLEDB.Oracle.1&quo ...

  6. ADO.NET—数据提供程序(连接类)

    .NET Framework 数据提供程序是专门为数据处理以及快速地只进.只读访问数据而设计的组件. 一.Connection 1.介绍 开启程序和数据库之间的连结 ADO.NET底层 可自己产生对象 ...

  7. IE 8 中自定义自己的 Search Provider (搜索提供程序)

    介绍 本文会为大家展示如果使用VS 2008 来创建基于IE8 的搜索提供程序, 以及在其中添加文本搜索建议和带有图片的搜索建议. 目的 学习如何使用VS 2008 来制作自己的搜索提供程序 步骤1 ...

  8. Arduino可穿戴教程之第一个程序——连接硬件选择板子(二)

    Arduino可穿戴教程之第一个程序--连接硬件选择板子(二) 2.4.2  连接硬件 在选择好示例程序后就可以将LilyPad通过LilyPad编程器连接到电脑了. 2.4.3  选择板子 如果你了 ...

  9. System.InvalidOperationException:“未在本地计算机上注册“Microsoft.ACE.OLEDB.12.0”提供程序

    [写在前面] 今天在做c#和ACCESS的连接测试时出现了如下图的BUG: (本人VS为2017,access为2016 64位专业版) CODES: 报错提示 error location [原因分 ...

最新文章

  1. jmeter ant的html结果为空,Ant Jmeter Jenkins生成html测试报告
  2. 【安全漏洞】黑客利用IE 0 day漏洞部署VBA恶意软件
  3. 如何设定vs2012用linux文件格式,Visual Studio 2012发布网站详细步骤
  4. AI:IPPR的数学表示-CNN方法
  5. python如何退出命令行_如何退出python命令行
  6. leetcode1487. 保证文件名唯一
  7. 阶段1 语言基础+高级_1-3-Java语言高级_04-集合_05 List集合_4_Vector集合
  8. 双路服务器单路运行,架构设计-具体案例求解惑:两个单路服务器比一个双路服务器性能高100%?...
  9. Google 如何设计与构建超大规模的软件系统
  10. 数字的与或非处理表中的多个状态(二)
  11. c语言模拟题第五套,2013年计算机二级C语言考试全真模拟试题第五套
  12. java 弱引用 使用场景_Java 强软弱虚引用介绍及使用场景
  13. idea保存快捷键_idea 快捷键
  14. 学习笔记之30个常用的maven命令
  15. mysql 生日_MySQL数据库之MySql查询生日的两种方式
  16. 即时通信工具中同步离线会话消息的方法及装置
  17. Linux挖矿病毒查杀
  18. Τεχνική υποστήριξη
  19. 高通驱动开发参考(二)
  20. 论文写作: 一点心得

热门文章

  1. 从16.6%到74.2%,谷歌新模型刷新ImageNet纪录,第一作者是上海交大毕业生谢其哲...
  2. Android-Lifecycle超能解析-生命周期的那些事儿
  3. 动态rem与1px边框问题的理解
  4. ionic app调试问题
  5. javaList容器中容易忽略的知识点
  6. Eclipse使用EGit管理git@OSC项目
  7. c++中可以对类中私有成员中的静态变量初始化吗?
  8. SQL Server 2008中原生的分层数据类型:hierarchyid
  9. DataBinder
  10. 【翻译】Pro LINQ Language Integrated Query in C# 2008 -- 第三章 (LINQ TO Objects) 第一节