Winds-Studio / Leaf

Personal Performance fork, A Minecraft Server Software for Winds Network
Other
201 stars 27 forks source link

Optimize Thread Wait Logic in BlockableEventLoop #69

Closed HaHaWTH closed 1 month ago

HaHaWTH commented 1 month ago

This PR should fix MC-183518. The current implementation in BlockableEventLoop involves yielding the thread before parking, which is unnecessary and can lead to inefficient thread scheduling and higher CPU usage.

Changes made:

Reasoning: Yielding the thread is redundant if the thread is about to be parked immediately afterward.

Reference:

Dreeam-qwq commented 1 month ago

GO