Open kirides opened 3 weeks ago
I have been planning to look into LibraryImport
for quite some time but didn't get to it. Hopefully I will find time for it in the next few weeks.
Other suggestions look interesting too. If you want to feel free to send a PR and I will be happy to review it.
@kirides Implemented Guid and BitString suggestions in c83fafaaeb
LibraryImport
requires #ifdef-s to check for .net 7 as it is unavailable in the previous versions. @kirides Want to send a PR?
This project may benefit a lot from using
LibraryImport
-Attribute instead ofDllImport
(or combined with? idk if and how fallback would work)As DuckDb is in Process, reducing the marshalling overhead by introducing LibraryImport may further increase throughput.
Side note: Things like
StringVectorDataReader
may also benefit from usingstring.Create(....)
to reduce allocations to just a single "string", removing the additionalnew char[...]
allocation.Also
DuckDB.NET.Data.Extensions.GuidConverter
may benefit a lot from usingSpan<char> buffer = stackalloc char[36]
to build the guid-representation in memory without allocating at all.