FASTER icon indicating copy to clipboard operation
FASTER copied to clipboard

AOT Support

Open ghost-pep opened this issue 1 year ago • 1 comments

Hi! Does FASTER support AOT? When I try to run with AOT I get hanging whenever I try to checkpoint and I assume the library is doing some runtime reflection that is not supported by AOT

ghost-pep avatar Jul 25 '24 18:07 ghost-pep

WinDbg can be helpful for tracking down such things. For example, Running an AOT-compiled app that uses FasterKV results in a stack trace that starts off like this:

Application failed: System.NotSupportedException: 'FASTER.core.Utility.IsBlittable[System.Byte]()' is missing native code. MethodInfo.MakeGenericMethod() is not compatible with AOT compilation. Inspect and fix AOT related warnings that were generated when the app was published. For more information see https://aka.ms/nativeaot-compatibility
   at System.Reflection.Runtime.MethodInfos.RuntimeNamedMethodInfo`1.GetUncachedMethodInvoker(RuntimeTypeInfo[], MemberInfo) + 0x74
   at System.Reflection.Runtime.MethodInfos.RuntimeNamedMethodInfo`1.MakeGenericMethod(Type[]) + 0x189
   at FASTER.core.Utility.IsBlittableType(Type) + 0x78
   at FASTER.core.FasterEqualityComparer.Get[T]() + 0x105
   at FASTER.core.FasterKV`2..ctor(Int64, LogSettings, CheckpointSettings, SerializerSettings`2, IFasterEqualityComparer`1, VariableLengthStructSettings`2, Boolean, ConcurrencyControlMode, ILoggerFactory, ILogger, Int32) + 0x1ce
   at FASTER.core.FasterKV`2..ctor(FasterKVSettings`2) + 0xa6

This example probably not directly relevant for the base FASTER library.

henricj avatar Oct 26 '24 02:10 henricj