thorium-cfx / mono_v2_get_started

Mono v2 runtime for FiveM/RedM
36 stars 3 forks source link

Improvement compared to external libraries? #33

Closed DaniGP17 closed 8 months ago

DaniGP17 commented 10 months ago

Goal

First of all, I want to apologize because I know this is not the place to ask this question.

My question is whether this V2 has a longer execution time than the previous one, I want to make a script that will be based mainly on a library and although V2 can be used, I would like to know if the execution speed of the library is independent of the environment of execution. Because I'm a little worried about the mono flag potentially expiring and causing people who use my script to stop working.

Thanks in advance.

Importancy

Prerequisite for my project

Edit: I have been testing and the performance of the mysqlconnector library is very different in the current version of C# than in V2.

Here I will show the execution averages of queries with the same code but using different versions. V1:

Average results from 1000 iterations (ms)
0.4295ms

V2:

Average results from 1000 iterations (ms)
0.0911 ms

Therefore, it would be better for me to use V2 because everything works but the problem is the mono flag.

Sasino97 commented 9 months ago

Guys mono v2 was very likely discontinued

DaniGP17 commented 9 months ago

I hope that when they have time they continue it because it is just what the C# version of Fivem was missing, I don't know what it needs to do either, right now I think that most of the possibilities that FiveM offers can be used

thorium-cfx commented 9 months ago

Hello Dani, mono rt2 (v2) is still on our roadmap. We currently have other projects that take precedence and will add quite some changes to this environment as well, once those are finished we can finally continue this environment and plan on releasing it.

Regarding your initial question: performance of external libraries shouldn't change, outside of Task related scheduling, which is no longer manually handled in v2, maybe that's influencing your test code? Apart from that you could expect performance increases in anything in the CitizenFX.* namespace, i.e.: our assemblies.

Hope this answers your question.

DaniGP17 commented 9 months ago

Regarding your initial question: performance of external libraries shouldn't change, outside of Task related scheduling, which is no longer manually handled in v2, maybe that's influencing your test code? Apart from that you could expect performance increases in anything in the CitizenFX.* namespace, i.e.: our assemblies.

Thanks for answering, what I have been doing has been creating an export to perform a query using the same code in V2 and V1 and from lua I have executed the benchmark, that is why I ask if V2 can have a higher execution speed of the libraries, you have said that the CFX functions will work faster, I don't know if this has to do with the explanation of my doubt.

thorium-cfx commented 9 months ago

what I have been doing has been creating an export to perform a query using the same code in V2 and V1 and from lua I have executed the benchmark

If you're indeed using the export system (hence this is part of CitizenFX.*), then yes that will have quite the impact. In that particular case, the export with all subsystems, e.g.: (de)serialization, is a lot more performant and can easily explain this difference. It doesn't change the actual external library code you are running.

Hope this makes sense.