Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/performance/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# SQLite transactionscope性能问题_C#_Performance_Sqlite_Transactions - Fatal编程技术网

C# SQLite transactionscope性能问题

C# SQLite transactionscope性能问题,c#,performance,sqlite,transactions,C#,Performance,Sqlite,Transactions,我正在使用ANTS performance profiler在我的应用程序中搜索性能问题 我在使用事务作用域时获得了很高的CPU百分比,如下所示: 此方法只调用一次(应用程序启动时) 为什么它给了我一个很高的百分比?对于只调用一次的select语句来说,事务作用域是一种糟糕的方式吗 编辑: 有更多的方法使用另一个具有相同transactionscope和select语句的方法,但是这些方法每1000毫秒(1秒)调用一次 当我删除transactionscope时,vs中的输出窗口会告诉我数据库

我正在使用ANTS performance profiler在我的应用程序中搜索性能问题

我在使用事务作用域时获得了很高的CPU百分比,如下所示:

此方法只调用一次(应用程序启动时) 为什么它给了我一个很高的百分比?对于只调用一次的select语句来说,事务作用域是一种糟糕的方式吗

编辑:

有更多的方法使用另一个具有相同transactionscope和select语句的方法,但是这些方法每1000毫秒(1秒)调用一次


当我删除transactionscope时,vs中的输出窗口会告诉我数据库有时会锁定。因此,建议我使用transactionscope,但它会降低我的性能,我该怎么办?

如果您只发出select语句,则不需要事务,这样您就可以安全地删除该语句

此外,如果该语句在应用程序启动时只执行一次,我也不会担心它