When using a bed or a respawn anchor, there is noticeable lag. This happens when the player sleeps in the bed or sets the spawn point.
This seems to happen mostly when a bed or respawn anchor is used for the first time after loading the world. After the first use, subsequent uses appear normal. It is difficult to reproduce in a newly-created world.
The issue is most likely to occur when a player uses a bed or respawn anchor for the first time when sleeping is not possible. A clear lag spike occurs before the game displays the message: "You can sleep only at night and during thunderstorms". Sometimes it happens before sleeping in a bed successfully but this is less common. It will only happen once per session.
Attachments
Comments 10
Screenshot attached as https://bugs.mojang.com/secure/attachment/346297/2020-11-03_21.58.30.png, with Alt-F3 (to show performance).
A possible workaround is to use a bed in another save game, save that game, and then load up the game where the bed lag occurs. This suggests the cause of the lag is client-side.
I can confirm this happens not just with beds but when anything appears in chat for the first time after loading a world, whether it's an advancement or "respawn point set" or just sleeping in a bed. This consistently happens every time a world is loaded, but only for the first time something would come up in chat.
Please provide a screenshot with the F3 Debug screen enabled