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

Optimize item loading with a delay #268

Merged
merged 2 commits into from
Dec 13, 2017
Merged

Conversation

stickz
Copy link
Contributor

@stickz stickz commented Dec 6, 2016

With an approximation of over 150 items in the pointshop, the Garry's Mod game client will start hitching, because too many 'DPointShopItem' objects are being created at once. This optimization creates a 50ms delay, between creating each 'DPointShopItem' object. It allows the rest of the GUI to continue loading before all the items have completed. Hitching is reduced by approximately 80% and loading times are also reduced. This should theoretically triple the number of possible items, without an extended freeze period.

With an approximation of over 150 items in the pointshop, the Garry's Mod game client will start hitching, because too many 'DPointShopItem' objects are being created at once. This optimization creates a 50ms delay, when each 'DPointShopItem' object is created. It allows the rest of the GUI to continue loading before all the items have completed. Hitching is reduced by approximately 80% and loading times are also reduced. This should theoretically triple the number of possible items, without an extended freeze period.
@stickz stickz changed the title Optimize item loading with a 50ms delay Optimize item loading with a delay Dec 6, 2016
@stickz
Copy link
Contributor Author

stickz commented Dec 6, 2016

When testing this further, I found that a 50ms initial delay and a 15ms delay for each item thereafter works better. This achieves the same result, while loading the pointshop over three times faster than before!

@handsomematt handsomematt merged commit 6c7f32f into adamdburton:master Dec 13, 2017
@handsomematt
Copy link
Collaborator

1 year later

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants