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

Optimizations + Stop murdering of server #86

Merged
merged 8 commits into from
Aug 3, 2023

Conversation

JnKTechstuff
Copy link
Contributor

@JnKTechstuff JnKTechstuff commented Aug 2, 2023

Overview

Stops spamming of GetPlayerData() constantly

Details

Stops spamming of GetPlayerData() constantly in favor of simply getting the data on load in and updating the job via event. Also when restarting of the script live instead of making every client request the data from the server we just send it out to every client reducing the hitch on restart with lots of properties. We have around 200 properties and this would cause a 1.5-2 second hitch on load in for players. This removes that hitch or reduces it to about 250-300ms which is way more manageable.

UI Changes / Functionality

None

Testing Steps

We ran beta tests with 5-6 people the other night. Some formatting changes were made so hopefully there are no syntax errors. Approximately 200 properties are loaded via data.

  • Did you test the changes you made?
  • Did you test core functionality of the script to ensure your changes do not regress other areas?
  • Did you test your changes in multiplayer to ensure it works correctly on all clients?

Stop the GetPlayerData() spam
Do not use Player because it is a preset global
Stop murdering server on restart
Update main table
Stop GetPlayerData() spam
@ImXirvin
Copy link
Contributor

ImXirvin commented Aug 2, 2023

Thats actually nice, good job. Dont know why I didnt think of that. Dont really do QB like that I guess.

@MonkeyWhisper
Copy link
Member

Overview

Stops spamming of GetPlayerData() constantly

Details

Stops spamming of GetPlayerData() constantly in favor of simply getting the data on load in and updating the job via event. Also when restarting of the script live instead of making every client request the data from the server we just send it out to every client reducing the hitch on restart with lots of properties. We have around 200 properties and this would cause a 1.5-2 second hitch on load in for players. This removes that hitch or reduces it to about 250-300ms which is way more manageable.

UI Changes / Functionality

None

Testing Steps

We ran beta tests with 5-6 people the other night. Some formatting changes were made so hopefully there are no syntax errors. Approximately 200 properties are loaded via data.

  • Did you test the changes you made?
  • Did you test core functionality of the script to ensure your changes do not regress other areas?
  • Did you test your changes in multiplayer to ensure it works correctly on all clients?

Nice PR, thank you. Is this live on your server and actively working as expected?

@sxetikos
Copy link

sxetikos commented Aug 2, 2023

Resmon on latest release

0.00ms idle
0.03ms on apartment enter/exit
0.04ms on furniute menu while on apartment
0.00ms idle on apartment.
0.14ms on house enter on first enter after that 0.02
0.04ms on furtunite menu while on house idle
0.30ms on furnute menu moving an object

Resmon on PR
0.00ms idle
0.03ms on enter
0.01ms on exit
0.04ms on furtnute menu
0.01ms on house enter
0.01ms on house exit
0.04ms on furniture menu
0.29ms while moving an object

No errors

@JnKTechstuff
Copy link
Contributor Author

Nice PR, thank you. Is this live on your server and actively working as expected?

As of 4 hours ago, yes

@JnKTechstuff
Copy link
Contributor Author

JnKTechstuff commented Aug 2, 2023

Resmon on latest release

0.00ms idle 0.03ms on apartment enter/exit 0.04ms on furniute menu while on apartment 0.00ms idle on apartment. 0.14ms on house enter on first enter after that 0.02 0.04ms on furtunite menu while on house idle 0.30ms on furnute menu moving an object

Resmon on PR 0.00ms idle 0.03ms on enter 0.01ms on exit 0.04ms on furtnute menu 0.01ms on house enter 0.01ms on house exit 0.04ms on furniture menu 0.29ms while moving an object

No errors

When giving perf numbers I think its very important to give your dataset size. Our actual dataset size was: 279 properties.

Also performance in the menus and stuff is entirely dependent upon config. More stuff will mean more lag. Finally, a house performance loading is also dependent on the number of furniture loaded. So its really hard to quantify your numbers tbh.

All I can tell you is that it lagged before and it doesn't now

@MonkeyWhisper
Copy link
Member

Tested and working

client/client.lua Outdated Show resolved Hide resolved
Update for requested changes
Requested changes
@BackSH00TER BackSH00TER merged commit d68ca86 into Project-Sloth:main Aug 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants