FoxxMD / context-mod

an event-based, reddit moderation bot built on top of snoowrap and written in typescript
https://contextmod.dev
MIT License
49 stars 11 forks source link

Reduce memory consumption and increase performance for image comparison #28

Closed FoxxMD closed 2 years ago

FoxxMD commented 2 years ago
FoxxMD commented 2 years ago

Turns out the majority of run time is due to downloading images. Also using "ignore colors" or setting a bounding box on comparison actually slowed comparisons down b/c resemble is doing more work in those instances...

Was able to reduce rule run time in f8fc63991f6b8f732878c722790ee7a3a07d9bff by:

Unfortunately comparisons in parallel is making memory usage skyrocket. Need to investigate p-map so i can set concurrency to something reasonable (or user-configurable)

FoxxMD commented 2 years ago

Fixed mostly everything by 976f310f512ed20d70dc900b4901e17658ebc18a