jamescourtney / FlatSharp

Fast, idiomatic C# implementation of Flatbuffers

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Performance] Investigate SIMD Intrinsics

jamescourtney opened this issue · comments

.NET Core 3.1 and 5.0 support SIMD intrinsics.

  • Are any of these useful to FlatSharp? Some candidates:
    • GetMaxSize for tables and vectors.
    • VTable equality checks (does Span.SequenceEqual already do this internally?)
  • If any of them seem useful, can we use them without introducing unsafe code?

Span.SequenceEqual does use intrinsics heavily. One optimization we may be able to make is to compare the first int of each vtable before invoking sequence equal. That's allows testing the table length before invoking the "heavy" logic of sequenceequal.