FSharp.Stats icon indicating copy to clipboard operation
FSharp.Stats copied to clipboard

[Perf] Make library AOT-compatible

Open alexandrehtrb opened this issue 7 months ago • 2 comments

Hello,

It would be interesting to make this library AOT-compatible, for performance benefits.

https://devblogs.microsoft.com/dotnet/creating-aot-compatible-libraries/

Also adding .NET 9 as a target framework.

I tested AOT compatibility on this repo and on FSharpAux repo, both seem to be OK.

In this repo, FSharp.Status seems to not use anymore OptimizedPriorityQueue package, maybe it could be removed from the fsproj.

alexandrehtrb avatar Apr 17 '25 14:04 alexandrehtrb

Thanks for reporting @alexandrehtrb It seems the PriorityQueue is used in https://github.com/zieglerSe/FSharp.Stats/blob/9cc43ef84b692ed0d68181d7e224036ddfb76335/src/FSharp.Stats/ML/Unsupervised/HierarchicalClustering.fs#L5.

@kMutagene, do you have insights regarding the AOT-compatibility

bvenn avatar Apr 23 '25 12:04 bvenn

@kMutagene, do you have insights regarding the AOT-compatibility

Well it seems from the linked article that we can only know if its fine if roslyn analyzers do not throw warnings or we do not get warnings when compiling to AOT. Not sure if the first option will work for F# as F# has its own compiler and does not use roslyn. The second looks like much manual work to me.

TLDR;: only if we can do automated testing for AOT compilation

However, i agree that we might target a newer .net version (although i'd always go for LTS), i think some of the changes that @muehlhaus is working on need .net 8 anyways

kMutagene avatar Apr 23 '25 13:04 kMutagene