Durss / Twitchat

Full featured Twitch chat alternative to fill gaps from the official one.
https://twitchat.fr
GNU General Public License v3.0
240 stars 27 forks source link

Suggestion - Add an advanced option for chat command hide functionality #69

Open Nahalyd opened 3 months ago

Nahalyd commented 3 months ago

Context:

Suggestion:

Edit: typo

Durss commented 6 days ago

Hello !

First of all, sorry for very late answer.

The possibility to filter by regexp wouldn't be technically complicated but may have bad impacts on performances :/ There are lots of tests to define wether a message should be displayed on a column or not and a regex is ~20 times slower than the current indexOf solution.

str.indexOf("!") //~1ms for 1 000 000 execs
/!\S+/g.test(str) //~20-25ms for 1 000 000 execs

Now, even if it's comparatively slower, it actually remains very low numbers so switching for regexp probably wouldn't be so bad for performances. I'd just need to make sure users don't input massive regexp that would really kill performances.

I'll try to see if I make this possible vor v13