It seems that Minecraft Client is checking whether a player is blocked or not, this causes network request happen in the render thread. In bad network environment, the lag is way significant. On the other hand, if we tested the lag in offline mode, it will no longer exist. Here is a VisualVM Sampling result, you can see the Yggdrasil's HTTP API just blocked the render thread from handling user input and render the frame.
[media]
(used fabric intermediary names to debug and yarn names in blue marks above)
I used Mixin to skip the check, the lag I'm suffering is gone.
I think the HTTP Request should not happen in the Render Thread. The block list should be fetched either in other threads or before playing.
It seems that Minecraft Client is checking whether a player is blocked or not, this causes network request happen in the render thread. In bad network environment, the lag is way significant. On the other hand, if we tested the lag in offline mode, it will no longer exist. Here is a VisualVM Sampling result, you can see the Yggdrasil's HTTP API just blocked the render thread from handling user input and render the frame.
[media](used fabric intermediary names to debug and yarn names in blue marks above)
I used Mixin to skip the check, the lag I'm suffering is gone.
I think the HTTP Request should not happen in the Render Thread. The block list should be fetched either in other threads or before playing.