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
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