-
Notifications
You must be signed in to change notification settings - Fork 23
Performance
ChatControl Red is a highly-performant and well-optimized plugin IF you understand how it works and configure it with respect to your hardware and player base.
The magic lays in the word "if". For example: For every chat message, we have to iterate through each word, here's some operations we do to illustrate:
- Add gradients if used
- Launch JavaScript if format conditions are used
- Replace variables, including JavaScript ones
- Check each word for all rules
- Log the message
- Send it to spies (where some of the above re-applies again)
That's just an illustration for what happens with each chat message. Below you'll find the other parts of the plugin that are heavily affected based on your configuration:
- Rules (rules/ folder) — their amount, conditions AND each regex
- Formats (formats/ folder) - each format option such as JavaScript conditions
- Messages (messages/ folder) - their amount and conditions
- Variables (variables/ folder) - their amount and conditions
Here's quick tips to toggle in your settings.yml to improve ChatControl's performance:
- Rules.Case_Insensitive set to false: Disables the "match" operator evaluating messages case insensitively.
- Private_Messages.Toasts set to false: Disable write/read disk operations from showing Advancements (as popups). Notable performance boost.
- Messages.Async set to "[join, death, timed]": Moves showing messages off of the main thread. Please see the command above that key for known issues and wontfixes with this!
This is caused by data.db being saved when players disconnect, resulting in lag if you have a large data.db (you can just open it with Notepad++ to inspect).
You could in worst case just remove data.db or decrease Clear_Data_If_Inactive. Removing data.db would reset player channel options, their nicks, chat colors etc. I highly recommend enabling MySQL, as we handle data loading/saving asynchronously when using it.
The larger your regular expression, the more cycles your computer need to evaluate it. You can use regex101.com website to test how many cycles and time approximately each expression takes.
When testing a rule on regex101.com make sure you toggle "insensitive" and "unicode" flags when testing expressions to get accurate (including performance) results: https://i.imgur.com/QEDZx5N.png
If you're still experiencing performance degradation, please install the spark profiler and open a new issue ticket with a full report from a running production server (ensure to keep profiling for a significant enough time such as 30 minutes or even 2 hours on smaller servers).
© MineAcademy | Code Unique Minecraft Plugins & Servers In 20 Days
Installation
Troubleshooting
Basics
Learn
- Channels
- Formats
- Rules
- Rules Creator
- Messages
- Variables
- JavaScript Variables
- Running JavaScript Code
- Logs
- Spying
- Books
Tweaking
- Performance
- Chat Bots
- Groups
- Sound Notify
- Newcomer
- Super Cool Messages
- Custom Commands
- Listener Priorities
- JSON
- API
Tutorials
About