-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
C# Optimizations #12
Comments
Also for convenience you could use record structs and LINQ So
into
Also, in C# it's common to use PascalCase for public properties and methods. |
Pushed some changes on #15 that should help here! |
Also take a look at this. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey! Always fun to see these comparisons :)
Couple tips for improving the .net version performance:
You're using structs as readonly so change
struct
toreadonly struct
. This helps the compiler do some additional optimizations.You can improve the parsing performance and memory consumption probably by a lot by reading the file to a single string and then splitting it into (ReadOnly)Spans as much as possible rather than creating lots and lots of small strings.
You can also enable rigorous null safety by adding
<Nullable>enable</Nullable>
to your project file. Or by other means described here: https://learn.microsoft.com/en-us/dotnet/csharp/nullable-references#nullable-contextsThe text was updated successfully, but these errors were encountered: