Your patch seems OK. but I didn't see a big difference here. I think maybe the solution is using a limit for number of "tile"s? Because when testing this branch I found that when using a high scale e.g. 1200% "qpdfview.exe" uses more than 120,000 handles and if I change scale factor to 1933% there will be more than 300,000 handles used by qpdfview.exe
Your patch seems OK. but I didn't see a big difference here. I think maybe the solution is using a limit for number of "tile"s? Because when testing this branch I found that when using a high scale e.g. 1200% "qpdfview.exe" uses more than 120,000 handles and if I change scale factor to 1933% there will be more than 300,000 handles used by qpdfview.exe