Skript/Server Version
Server Version: 1.21.11-168-ea288d3 (MC: 1.21.11)
Skript Version: 2.15.3 (skriptlang-github)
Installed Skript Addons:
- skript-placeholders v1.7.1 (https://github.com/APickledWalrus/skript-placeholders)
- DiSky v4.29.0
- skript-reflect v2.6.3 (https://github.com/SkriptLang/skript-reflect)
- skript-db v1.5.0
- SkBee v3.18.3 (https://github.com/ShaneBeee/SkBee)
- SkRedis v2.3.2
Installed dependencies:
- Vault v1.7.3-b131
- WorldGuard v7.0.17+2370-e42d8bc
Bug Description
Deleting a variable whose list index is a long numeric-only value can cause a noticeable server lag spike.
I noticed this while using long numeric IDs as list variable indices, such as Discord snowflake IDs or timestamp-like IDs. Creating or setting the variable is fine, but deleting it causes the server to freeze briefly.
Example problematic index:
853420195002187776
When the same value is prefixed with a non-numeric character, such as:
id_853420195002187776
the lag spike does not happen.
Expected Behavior
Deleting a variable should not cause a large lag spike depending on whether the list index is numeric-only.
These two cases should have similar performance:
delete {test::853420195002187776}
delete {test::id_853420195002187776}
Steps to Reproduce
- Load this test script:
command /testnumericdelete:
trigger:
set {_id} to "853420195002187776"
set {delete-test::%{_id}%} to "test"
set {_start} to unix timestamp of now
send "Before numeric-only delete"
delete {delete-test::%{_id}%}
set {_elapsed} to (unix timestamp of now) - {_start}
send "After numeric-only delete"
send "numeric-only delete elapsed: %{_elapsed}% seconds"
command /testprefixeddelete:
trigger:
set {_id} to "id_853420195002187776"
set {delete-test::%{_id}%} to "test"
set {_start} to unix timestamp of now
send "Before prefixed delete"
delete {delete-test::%{_id}%}
set {_elapsed} to (unix timestamp of now) - {_start}
send "After prefixed delete"
send "prefixed delete elapsed: %{_elapsed}% seconds"
- Run
/testnumericdelete.
- Check the elapsed time message and whether the server briefly freezes.
- Run
/testprefixeddelete.
- Compare the elapsed time and server behavior.
In my production script, changing mailbox IDs from numeric-only timestamp keys to prefixed keys fixed the lag immediately:
# Lagged when deleting
{mailbox::%uuid%::1780000000000000000}
# No lag when deleting
{mailbox::%uuid%::m_1780000000000000000}
Errors or Screenshots
Other
No response
Agreement
Skript/Server Version
Bug Description
Deleting a variable whose list index is a long numeric-only value can cause a noticeable server lag spike.
I noticed this while using long numeric IDs as list variable indices, such as Discord snowflake IDs or timestamp-like IDs. Creating or setting the variable is fine, but deleting it causes the server to freeze briefly.
Example problematic index:
853420195002187776When the same value is prefixed with a non-numeric character, such as:
id_853420195002187776the lag spike does not happen.
Expected Behavior
Deleting a variable should not cause a large lag spike depending on whether the list index is numeric-only.
These two cases should have similar performance:
Steps to Reproduce
/testnumericdelete./testprefixeddelete.In my production script, changing mailbox IDs from numeric-only timestamp keys to prefixed keys fixed the lag immediately:
Errors or Screenshots
Other
No response
Agreement