SQLite Forum

Possibly wasteful allocations in SQLiteDataReader Close and Dispose
Login

Possibly wasteful allocations in SQLiteDataReader Close and Dispose

(1) By appel (appel_) on 2024-05-21 10:12:14 [source]

When profiling a workload using System.Data.SQLite that writes data into an sqlite database it looks like about 2/3 of the memory allocation done is to create the ConnectionEventArgs and its data array. Perhaps not a big deal, but it seems a bit wasteful when no one is subscribing to the event. For CPU time it accounts for about 10% according to dotTrace.

Not sure if it can or is worthwhile to improve but thought I should at least mention it.

(2.3) By mistachkin on 2024-05-24 19:56:51 edited from 2.2 in reply to 1 [link] [source]

Thanks for the report. I will look into this behavior.

EDIT #2: Tests have been added and the changes have been merged to trunk:

https://system.data.sqlite.org/index.html/info/9e98945ce3a03e19