Skip to content

Eliminate most provider match checks to improve speed#9

Open
dullbananas wants to merge 3 commits intojendrikw:mainfrom
dullbananas:map
Open

Eliminate most provider match checks to improve speed#9
dullbananas wants to merge 3 commits intojendrikw:mainfrom
dullbananas:map

Conversation

@dullbananas
Copy link
Contributor

No description provided.

@dessalines
Copy link
Contributor

cc @jendrikw

@jendrikw
Copy link
Owner

Sorry for not responding earlier, I was a little busy. reviewing now

@dessalines
Copy link
Contributor

bump

@jendrikw
Copy link
Owner

So I thought about this and it feels like writing our own little regex parser, which obviously sounds like a bad idea. Are you sure the regexes are a bottleneck for lemmy? If you reuse the UrlCleaner instance, it should not take a significant amount of time.

@dullbananas
Copy link
Contributor Author

I'm pretty sure I didn't measure the impact on Lemmy's performance. But it's definitely not good to always loop through each regex to check for a match.

Possible alternatives:

  • put everything in one regex::RegexSet, if the regex library can efficiently handle regexes that have duplicated parts
  • for the clearurls json file, propose a different format that makes it easy to do filtering mostly with hashmaps/hashsets, instead of checking a lot of regexes every time

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants