Skip to content
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

Improve reflection utils speed (#377) #378

Merged

Conversation

DemoJameson
Copy link
Contributor

here is the benchmark

BenchmarkDotNet=v0.13.1, OS=Windows 10.0.19044.1620 (21H2)
Intel Core i7-4790 CPU 3.60GHz (Haswell), 1 CPU, 8 logical and 4 physical cores
  [Host]   : .NET Framework 4.8 (4.8.4470.0), X64 RyuJIT
  Mono x64 : Mono 6.12.0 (Visual Studio), X64 

Job=Mono x64  Runtime=Mono x64  

|                          Method |        Mean |     Error |     StdDev | Ratio | RatioSD |  Gen 0 | Allocated |
|-------------------------------- |------------:|----------:|-----------:|------:|--------:|-------:|----------:|
|                       DirectSet |   0.6177 ns | 0.0482 ns |  0.0427 ns | 0.002 |    0.00 |      - |         - |
|               FieldInfoSetValue | 297.2050 ns | 5.6635 ns |  5.0206 ns | 1.000 |    0.00 |      - |         - |
|             R2API.SetFieldValue | 227.2970 ns | 4.5213 ns | 10.7454 ns | 0.802 |    0.04 | 0.0391 |         - |
| R2API.SetFieldValueAfterImprove |  90.1908 ns | 1.8251 ns |  3.5163 ns | 0.301 |    0.01 |      - |         - |
|   R2API.DirectInvokeSetDelegate |   2.7984 ns | 0.0871 ns |  0.1548 ns | 0.009 |    0.00 |      - |         - |

@CLAassistant
Copy link

CLAassistant commented Apr 8, 2022

CLA assistant check
All committers have signed the CLA.

Copy link
Member

@tristanmcpherson tristanmcpherson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The low level code here has been great, but seems the interface to it has been less than desired performance wise due to some oversights, and lack of benchmarking. Looks great, thanks for the contribution.

@tristanmcpherson tristanmcpherson merged commit 86c8b96 into risk-of-thunder:master Apr 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants