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

tweak(scripting/lua): speed up lua event serialization. #3003

Closed
wants to merge 1 commit into from

Conversation

icy4471
Copy link

@icy4471 icy4471 commented Dec 15, 2024

If there are no event handlers for the event, there is no need to unpack or set the source as they will never be used.

Goal of this PR

Significantly speeds up event serialization when there are no handlers available.

How is this PR achieving the goal

By returning early when there are no event handlers available.

This PR applies to the following area(s)

FiveM, RedM, Server, ScRT: Lua

Successfully tested on

Game builds: b3095

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

If there are no event handlers for the event, there is no need to unpack or set the source as they will never be used.
@github-actions github-actions bot added the invalid Requires changes before it's considered valid and can be (re)triaged label Dec 15, 2024
@icy4471 icy4471 changed the title tweak(scheduler.lua): speed up lua event serialization tweak(scripting/lua): speed up lua event serialization Dec 15, 2024
@icy4471 icy4471 changed the title tweak(scripting/lua): speed up lua event serialization tweak(scripting/lua): speed up lua event serialization. Dec 15, 2024
@icy4471 icy4471 closed this Dec 15, 2024
@icy4471 icy4471 deleted the master branch December 15, 2024 17:18
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