Version Used:
2.6.0-vs-for-mac-62303-01
Steps to Reproduce:
- Use the defautl SQLitePersistentStorage
- Wait for it to load
- Observe that 64MB are coming in from SQLitePCL.util.to_utf8
https://gist.github.com/Therzok/9ca7f361caaf0308640fa7b03da3ec8b
Expected Behavior:
http://source.roslyn.io/#Microsoft.CodeAnalysis.Workspaces.Desktop/Workspace/SQLite/Interop/SqlConnection.cs,210
Should be using cached values that can be passed to native. "main" and DataColumnName are both constants. DataTableName can also be cached per accessor kind
http://source.roslyn.io/#Microsoft.CodeAnalysis.Workspaces.Desktop/Workspace/SQLite/SQLitePersistentStorage.Accessor.cs,5203990dce13d1f4,references
Probably a lower level layer should be used for better performance. Passing in strings will cause SQLitePCL.raw to create byte arrays from the strings every time.
https://github.com/ericsink/SQLitePCL.raw/blob/master/src/cs/util.cs#L125
https://github.com/ericsink/SQLitePCL.raw/blob/d86a5b5311ff4cdbba54cda49c23a776bd888663/src/cs/sqlite3_pinvoke.cs#L282
Actual Behavior:
These strings are marshaled to byte arrays on every blob read.
Version Used:
2.6.0-vs-for-mac-62303-01
Steps to Reproduce:
https://gist.github.com/Therzok/9ca7f361caaf0308640fa7b03da3ec8b
Expected Behavior:
http://source.roslyn.io/#Microsoft.CodeAnalysis.Workspaces.Desktop/Workspace/SQLite/Interop/SqlConnection.cs,210
Should be using cached values that can be passed to native.
"main"andDataColumnNameare both constants.DataTableNamecan also be cached per accessor kindhttp://source.roslyn.io/#Microsoft.CodeAnalysis.Workspaces.Desktop/Workspace/SQLite/SQLitePersistentStorage.Accessor.cs,5203990dce13d1f4,references
Probably a lower level layer should be used for better performance. Passing in strings will cause SQLitePCL.raw to create byte arrays from the strings every time.
https://github.com/ericsink/SQLitePCL.raw/blob/master/src/cs/util.cs#L125
https://github.com/ericsink/SQLitePCL.raw/blob/d86a5b5311ff4cdbba54cda49c23a776bd888663/src/cs/sqlite3_pinvoke.cs#L282
Actual Behavior:
These strings are marshaled to byte arrays on every blob read.