Skip to content
This repository was archived by the owner on May 21, 2025. It is now read-only.

Conversation

Hona
Copy link

@Hona Hona commented Apr 17, 2024

I'm not huge on rust, so feel free to be brutal in code review, or decline this PR

This is a stab at allowing the DLLs to be invoked by other languages (e.g. C#)

I have a sample repo using this change (passing tests!)

https://github.com/Hona/demostf-parser-dotnet

Integration test that invokes & asserts something about the data out :)
https://github.com/Hona/demostf-parser-dotnet/blob/master/DemosTF.Parser.NET.Tests/IntegrationTests.cs#L29-L46

@Hona
Copy link
Author

Hona commented Apr 17, 2024

Also, benchmarking programatically running the exe, versus the PInvoke, gave me a good performance improvement:

// * Summary *

BenchmarkDotNet v0.13.12, Windows 11 (10.0.22621.3447/22H2/2022Update/SunValley2)
12th Gen Intel Core i7-12800H, 1 CPU, 20 logical and 14 physical cores
.NET SDK 8.0.204
  [Host]     : .NET 8.0.4 (8.0.424.16909), X64 RyuJIT AVX2
  DefaultJob : .NET 8.0.4 (8.0.424.16909), X64 RyuJIT AVX2


| Method               | Mean     | Error    | StdDev   |
|--------------------- |---------:|---------:|---------:|
| Analyze_ProcessStart | 43.20 ms | 0.829 ms | 1.107 ms |
| Analyze_PInvoke      | 30.51 ms | 0.606 ms | 1.679 ms |

Benchmark code here: https://github.com/Hona/demostf-parser-dotnet/blob/master/DemosTf.Parser.Benchmarks/Program.cs

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant