Jump to content

Question: CPU Usage


Recommended Posts

Well,

I am a guy who cares alot about avoiding cpu usage, so yeah I wanted to be sure of one information since I didn't find it in the wiki.

I had scripted a function and instead of re-scripting it in the whole gamemode resources, I used exports system to save some memory,

But I am afraid if these exports might cause lags/CPU Usage or not.

I just need a confirmation.

~Thanks in advance.

Link to comment
  • MTA Team

Test package: https://mega.nz/#!kYVzzaAb!CUEWe9llnrld ... 5sHrCgZRu0

Result:

  
[Local] (5s) Calls: 5534587 
[Export] (5s) Calls: 537927 
  
[Local_Long] (5s) Calls: 1471 
[Export_Long] (5s) Calls: 1421 
  
[Local_Long_Long] (5s) Calls: 707 
[Export_Long_Long] (5s) Calls: 718 

Legend:

Local is a resource-local function

Export is a foreign-resource export function

Long is a loop with 5000 iterations

Long Long is a loop with 10000 iterations

Summary

Local functions are super fast, but they are technically equal to the exported functions when they iterate a lot.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...