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

Update TooltipHandlerBurnTime.java #19

Merged
merged 1 commit into from
Aug 1, 2020
Merged

Update TooltipHandlerBurnTime.java #19

merged 1 commit into from
Aug 1, 2020

Conversation

TataTawa
Copy link

After performance profiling I found
TileEntityFurnace.getItemBurnTime(item);
is computationaly expensive. It occupied almost a cpu core forever, because NEI starts a task thread every few seconds and this line of code keep iteraing through all the furnance recipe in GTNH. Besides, usually the result of this computation is not useful.

Add thread name check will help performance and will not influence the player.
if (!Thread.currentThread().getName().startsWith("Client Thread")) return false;

After performance profiling I found 
TileEntityFurnace.getItemBurnTime(item); 
is computationaly expensive. It occupied almost a cpu core forever, because NEI starts a task thread every few seconds and this line of code keep iteraing through all the furnance recipe in GTNH. Besides, usually the result of this computation is not useful.

Add thread name check will help performance and will not influence the player.
if (!Thread.currentThread().getName().startsWith("Client Thread")) return false;
@repo-alt
Copy link

Why is that even called server side?

@Dream-Master Dream-Master requested review from Glease, a user and repo-alt August 1, 2020 08:08
@Dream-Master Dream-Master merged commit f492c45 into GTNewHorizons:master Aug 1, 2020
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.

4 participants