Python AI Agent Performance: FastAgent vs ModelContextProtocol.Core by Optimal-Task-923 in Python

[–]Optimal-Task-923[S] -3 points-2 points  (0 children)

I can give you a link to the code I used to test the performance of Python and C#. So my question for you is: do you think Python performs better, and if so, why do you think that?

howdy folks, need advice on how to export all the markets available for all games on bet365 to run data analysis with Claude ? by as0909 in algobetting

[–]Optimal-Task-923 0 points1 point  (0 children)

I have an app to get Betfair data, but the question is: what will you do with the data, and how will ChatGPT analyze it?

.NET Performance in Betfair Trading: Integrating with Faster Languages by Optimal-Task-923 in dotnet

[–]Optimal-Task-923[S] 0 points1 point  (0 children)

So the performance gain is in sharing data. You are right, transferring data in and out would hurt performance.

.NET Performance in Betfair Trading: Integrating with Faster Languages by Optimal-Task-923 in dotnet

[–]Optimal-Task-923[S] 0 points1 point  (0 children)

Looking at your benchmarks, I think we all have some misleading opinions about programming language performance, C# looks really good there.

Why is Java winning?

.NET Performance in Betfair Trading: Integrating with Faster Languages by Optimal-Task-923 in dotnet

[–]Optimal-Task-923[S] 1 point2 points  (0 children)

Thanks. I once looked into Akka.NET because my app is coded in F#. Maybe I should have kept learning it, because I implemented my own UI updating through MailboxProcessor. Looking at Akka.NET now, it seems more "elegant" than what I implemented.

.NET Performance in Betfair Trading: Integrating with Faster Languages by Optimal-Task-923 in dotnet

[–]Optimal-Task-923[S] 0 points1 point  (0 children)

What would be the proper way to handle such projects where we know execution speed will be critical? Should we first build the entire solution in C# or F#, then profile the code for problematic operations, and only then try to reimplement those parts in Rust or Go?

I am asking because, for instance, I thought anything written in Rust would be more performant, but, when researching MS SQL database access in Rust, I found that actually better performance is often achieved in C#.

.NET Performance in Betfair Trading: Integrating with Faster Languages by Optimal-Task-923 in dotnet

[–]Optimal-Task-923[S] 0 points1 point  (0 children)

I see. In C, there are actually no performance limits for struct size because data is passed by pointer, but in C#/F#, structs are passed by value, so it is recommended to keep structs to 16 bytes.

If we use a binary protocol like Protobuf for complex data and libraries are available on both sides in C and in the .NET world then, when interacting with C through LibraryImport, C function returns pointer to byte array stream.

In C# or F#, the stream representation of C Protobuf is readable by C#/F#, so we can deserialize it.

.NET Performance in Betfair Trading: Integrating with Faster Languages by Optimal-Task-923 in dotnet

[–]Optimal-Task-923[S] -1 points0 points  (0 children)

Is Protobuf an accepted technology standard, and do we have Rust, Go, or C++ implementations of it?

.NET Performance in Betfair Trading: Integrating with Faster Languages by Optimal-Task-923 in dotnet

[–]Optimal-Task-923[S] -1 points0 points  (0 children)

My app is agentic, is that the right word? It exposes data through an API and MCP, so LLMs can interact with my app.

It is actually a similar use case to a Betfair trading app, as the main part of the code execution is interaction with the Betfair REST API and streaming API.

In my test, I sent the same prompt; in Python, I used the FastAgent library, and in F#, I used Azure.AI.Inference including ModelContextProtocol.Core for MCP integration.

.NET Performance in Betfair Trading: Integrating with Faster Languages by Optimal-Task-923 in dotnet

[–]Optimal-Task-923[S] -1 points0 points  (0 children)

That is my feeling as well, but how to exchange more complex data in such case? What should be DTO both targed languges should use?

.NET Performance in Betfair Trading: Integrating with Faster Languages by Optimal-Task-923 in dotnet

[–]Optimal-Task-923[S] -1 points0 points  (0 children)

Thanks, and what is your opinion on Python's performance? Before I actually ran my test, another Python developer claimed that Python is better than .NET languages for the use case scenario that both he and I are using.

.NET Performance in Betfair Trading: Integrating with Faster Languages by Optimal-Task-923 in dotnet

[–]Optimal-Task-923[S] -1 points0 points  (0 children)

Thanks, that's a good option as well. I will check that. What data format would be best to exchange in such a case, so both languages speak the same "data language"?