02-10-2020, 07:53 PM
(This post was last modified: 02-10-2020, 08:44 PM by remkonoteboom.)
I just tested this out and this code is very very slow. The function that is doing this is in CustomLayoutWdg basically doing this:
from mako.template import Template
template = Template(html)
where html is just your code wrapped around <% ... %> tags.
I don't know what Mako is doing to make this so slow. Even wrapping your code in a command line script with the <% ... %> tags runs very very slow (2.5 seconds on my laptop). However, when I broke your single line into about 100 lines, then the execution speed when down to 0.04s. So it seems to be that the problem is handling a huge single line.
from mako.template import Template
template = Template(html)
where html is just your code wrapped around <% ... %> tags.
I don't know what Mako is doing to make this so slow. Even wrapping your code in a command line script with the <% ... %> tags runs very very slow (2.5 seconds on my laptop). However, when I broke your single line into about 100 lines, then the execution speed when down to 0.04s. So it seems to be that the problem is handling a huge single line.