We have noticed that when a page is rendered in cells 7.0+ via sheet-to-image and gridlines are switched on the render takes much longer than it does if they are switched off. This did not happen in the 3.n releases.
Could you please check if anything can be done to improve this as large sheets take an unacceptable time to render.
After an initial test using your code snippet, I can notice the performance goes down with grid lines on for Sheet-to-Image feature. I have logged a ticket with an id: CELLSJAVA-40136. We will look into it soon. Once we have any update, we will let you know here.
We have improved the rendering speed for gridlines, so please try this new fix (attached). Also, because some global(static) resources(such as fonts) need to be parsed and initialized when using rendering functions at first time and the initialization is a bit time consuming, so the first loop(with gridlines on) in your program will need more time than the second loop(with gridlines off). If you turn off gridlines in the first loop and turn on gridlines in the second loop, the difference between two situations may become smaller too.