I was playing with an inventory switcher script which stores the whole player's state per group of worlds. Simple thing so your event worlds get a different inventory than your survival worlds, which also store various information such as health, food level, enderchest, etc, and the player's XP.
Everything worked smoothly, storing the state of inventories, clearing and setting them within a single tick worked fine. Then I ran the script again a bit later, but this time it was slow. As in, I ran the script, the server froze for about a second, then went back to normal and switched my inventory. What was the source of this was my xp level.
Spark to the rescue, it's apparently com.denizenscript.denizen.scripts.commands.player.ExperienceCommand.XP_FOR_NEXT_LEVEL() which I assume to be called within <player.calculate_xp> causing the delay.
https://spark.lucko.me/0Wad0gd8kO
Simple enough command that seems to confirm: /ex experience set level 2147483647 (that number being the highest level i managed to set), followed by /ex narrate <player.calculate_xp>. And surely enough, the time between submitting the command and getting the XP back is by far longer than expected.