Skelmis / Discord-Anti-Spam

Ever wanted a bot to automatically deal with spammers? This is your Python library for it.
https://dpy-anti-spam.readthedocs.io/
MIT License
76 stars 17 forks source link

Improving library performance #20

Closed Skelmis closed 3 years ago

Skelmis commented 3 years ago

I'm looking to create a list here of things that currently 'exist' but definitely have better ways of doing things which could lead to a noticable increase in speeds

Given the nature of threading and locks within the library currently and how poorly they have faired in the past, I might look to outsource this as a public method which the user has the option to call themselves until future notice.

An ideal solution would not create any objects and be under O(n), currently however I am considering abstracting away all current storage objects into abc classes which merely have the dunder methods and the data required for them. This would allow for somewhat lighter weight comparisons and also might help to cleanup the classes in the library a bit

These are the only couple off my head now, however I would appreciate anything other developers have to contribute.

Skelmis commented 3 years ago
Skelmis commented 3 years ago

Another comment on 1 We should add the option for how long User objects should be persisted. They should be persisted so punishments carry over between kicks, however, if they get banned it can be assumed we can wipe their data. Don't think ill force the ban wipe, however, definitely having some form of logging to maintain whether or not a User can be cleaned up would be nice.

Programmatic view for if a User can be wiped:

Programmatic view for if a Guild can be wiped:

I think thats it?

Skelmis commented 3 years ago

The above should be profiled to see if its actually making a difference or not however..

Skelmis commented 3 years ago

Closing for now