Closed PMeira closed 1 year ago
Turns out just using LibraryImport
doesn't actually help much for DSS Sharp. The reason is that we already migrated to DSS C-API's GR interface, which API buffers to optimize some operations.
Allowing something like ArrayPool
would also be nice but I don't see it fitting in the current ("classic") API.
Source generators still might be useful for our future plans, including the new API. But, since there are thousands of functions in the API, we have to weight the benefits, that is, if the assembly gets too bloated, it will actually be slower. That's another issue though, so closing this for now.
For numeric data DSS Sharp was already quite faster than using the COM DLL (or OpenDSSDirect.DLL) due to the architecture of the official APIs, so this is not really a point of concern.
From P/Invoke source generation | Microsoft Docs:
.NET adoption is all over the place in terms of versions (a lot of people stuck with old Framework versions), but
LibraryImportAttribute
could reduce the overhead. This could be especially good for a future alternative API that would mirror dss::obj. For the moment we're already faster than the COM implementation in a lot of the API..NET 7 is still in the preview stage, so we have time to test before the final release (expected by the end of the year).