The default texture tile size seems to have a significant impact on performance.
On my iMac, a 256 texture size Krita (the current default) ran with 46 fps, whereas a 1024 texture size Krita runs with 94 fps (100 fps seems to be the maximum the OpenGL driver seems to be able to output to the screen).
This is also seen in profiling. With 256, KisOpenGLCanvas2::paintGL takes 6.9%/31.4% = 22% inside the main thread:
With 1024, it's 4.9%/36.7% = 13.4%:
With 4096, it's 2.7%/28.5% = 9.5%:
The actual time is spent inside glDrawArrays in KisOpenGLCanvas2::drawImage.
This patch thus proposes upping the default texture size to 2048. This should be safe for all desktop GPUs. For mobile platforms, there might be some old platforms that need 1024 (but see Krita's check below). I found some discussions on these topics here:
https://www.reddit.com/r/gamedev/comments/491uww/is_a_max_texture_size_of_2048x2048_a_safe_bet_for/
https://stackoverflow.com/questions/16931295/android-devices-gl-max-texture-size-limitation-safe-texture-size
As KisOpenGLImageTextures::getTextureSize additionally limits the configured or default texture size by the system limit (GL_MAX_TEXTURE_SIZE) anyway, this change should not break things, even if the platform does not support the configured size. The question is though if smaller GPUs get hurt in performance by going to the maximum possible texture size in this way. Inside KisTextureTile::update Krita does already use glTexSubImage2D to minimize only updating parts of the texture if possible and not the whole tile, so I imagine that having large texture sizes will usually not have a negative effect. As a last resort, the texture size can always be configured as a user setting.