Skip to content

tweak(chat): optimize client resource start - #4085

Open
solareon wants to merge 1 commit into
citizenfx:masterfrom
solareon:patch-1
Open

tweak(chat): optimize client resource start#4085
solareon wants to merge 1 commit into
citizenfx:masterfrom
solareon:patch-1

Conversation

@solareon

Copy link
Copy Markdown

Goal of this PR

Optimize chat resource for servers with large resource counts.

How is this PR achieving the goal

  1. Removal of table.insert (slow)
  2. Preventing every resource start from refreshing commands instead opting to refresh at most every 500ms during resource starts
  3. Eliminates one extra call to GetRegisteredCommands()
  4. Use numeric iterator instead of pairs/ipairs for looping through registered commands.

This PR applies to the following area(s)

FiveM/RedM
system-resources/chat

Successfully tested on

Game builds: 3258

Platforms: Windows, Linux

Checklist

  • Code compiles and has been tested successfully.
  • Code explains itself well and/or is documented.
  • My commit message explains what the changes do and what they are for.
  • No extra compilation warnings are added by these changes.

Fixes issues

n/a

@github-actions github-actions Bot added the invalid Requires changes before it's considered valid and can be (re)triaged label Jul 27, 2026
Applies two optimizations to the chat resource
1. use of numeric loops instead of ipairs()
2. gate refreshes to every 500ms max instead of once per resource start.

Signed-off-by: Solareon <769465+solareon@users.noreply.github.com>
@solareon solareon changed the title refactor(chat): optimize client resource start tweak(chat): optimize client resource start Jul 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

invalid Requires changes before it's considered valid and can be (re)triaged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant