Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

glightbox exponentially slower with increase of the number of images #44

Open
PlasmaHH opened this issue Jun 13, 2024 · 0 comments
Open

Comments

@PlasmaHH
Copy link

I have a page with ~50 images and it takes forever to build. Just take some existing project and copy an image directive a lot of times to see for yourself.

I have stopped it in the debugger and it hangs in the regex sub of plugin.py around line 139 where it tries to do all the replacements in one go. I guess the look back/ahead of the regex there degenerates when it sees that many image tags.

maybe using the find_all in regexes and then looping over the matches works better?

PS: I think the re.compile in the function would benefit from being on the class level to only be ever executed once

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

No branches or pull requests

1 participant