Coder Social home page Coder Social logo

fivem-benchmarks's Introduction

This is some benchmarking to test the performance of the different runtimes in Cfx

It should be noted that C# could not finish the string concatenation test because of it frequently trying to do stop-the-world garbage collection because every concatenation would create a new string object.

All of these tests were done with 1,000,000 iterations

Client Lua OAL Lua JS C# rt2
Native Execution 198.71ms 637.99ms 697.24 86.58ms
Concatenation 16.8s 16.8s 180.97ms DNF
2D Distance 180.99ms 178.83ms 33.23ms 4.16ms
3D Distance 184.48ms 183.60ms 33.34ms 6.71ms

All of these tests were done with 10,000 iterations

Client Lua OAL Lua JS C# rt2
Native Execution 2.40ms 6.19ms 48.15ms 1.59ms
Concatenation 1.80ms 1.89ms 4.72ms 40.83ms
2D Distance 1.89ms 2.43ms 15.99ms 0.13ms
3D Distance 1.91ms 1.86ms 15.87ms 90µs

All of these tests were done with 1,000,000 iterations with the optimized way to concatenate a large amount of strings in the specific runtime.

For C# this would be using StringBuilder, in Lua this would be adding all the string to a table and using table.concat

JS does not have an equivelent optimization (hence why its the slowest here)

Client Lua OAL Lua JS C# rt2
Concatenation 61.52ms 61.52ms 180.97ms 4.71ms

All of these tests were done with 10,000 iterations with the optimized way to concatenate a large amount of strings in the specific runtime.

Client Lua OAL Lua JS C# rt2
Concatenation 0.81ms 0.81ms 5.34ms 0.42ms

NOTE: These tests were done on RedM, in order to get OAL to work on RedM I had to do a custom build since it looks to have been forgotten about, this shouldn't impact the tests.

The basic way these benchmarks where done was:

  1. Put profiler record 500 in the client console
  2. ensure [resource-name]
  3. Wait for the the profiler to finish
  4. profiler view
  5. Results!

fivem-benchmarks's People

Contributors

avarianknight avatar

Stargazers

Gege avatar Cata_a avatar uyuyorum {um} avatar  avatar Jun Kojima avatar MythicalBro avatar Mohammad amin Jafarian avatar

Watchers

 avatar MythicalBro avatar

Forkers

ais1175

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.