Bug 113038 - Editing: Working with hi-res png-image is extremely slow (GDI only?)
Summary: Editing: Working with hi-res png-image is extremely slow (GDI only?)
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
4.2.0.4 release
Hardware: x86-64 (AMD64) Windows (All)
: medium minor
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: bibisected, bisected, perf, regression
: 104296 (view as bug list)
Depends on:
Blocks: Writer-Images Regressions-GraphicPrimitive2D
  Show dependency treegraph
 
Reported: 2017-10-10 14:33 UTC by Ole Tange
Modified: 2021-12-07 14:24 UTC (History)
7 users (show)

See Also:
Crash report or crash signature:


Attachments
Very high resolution PNG (668.64 KB, image/png)
2017-10-10 14:33 UTC, Ole Tange
Details
Bibisect log (3.71 KB, text/plain)
2017-11-06 09:02 UTC, Telesto
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ole Tange 2017-10-10 14:33:13 UTC
Description:
When working with hi-res images the system is extremely slow. It is as if the system works on the full uncompress image in full resolution instead of a scaled down version of the same.



Steps to Reproduce:
1. New text document
2. Insert attached image
3. Write text



Actual Results:  
The program is now very slow.


Expected Results:
Same speed as if the image had been in low-res.

Looking at the memory and CPU usage it looks as if Writer is working on the full-resolution image all the time.

It would be much preferable if Writer cached a version scaled for the current need and worked on that; and only recomputed a new scaled version when the image is resized or zoom is changed.

Microsoft Word has no problem using the hi-res image.




Reproducible: Always

User Profile Reset: No

Additional Info:
(Thanks for fixing the bug in 5.4.2.0, that made it impossible to work with hi-res images at all).


User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36
Comment 1 Ole Tange 2017-10-10 14:33:45 UTC
Created attachment 136896 [details]
Very high resolution PNG
Comment 2 Dieter 2017-10-16 20:53:16 UTC
I confirm, that LO gets really slow. It requires about 850MB RAM.

Version: 6.0.0.0.alpha0+ (x64)
Build ID: 465092047d5fa6ec6dd369372e712d76554570ff
CPU threads: 4; OS: Windows 6.19; UI render: GL; 
TinderBox: Win-x86_64@42, Branch:master, Time: 2017-09-26_23:16:01
Locale: de-DE (de_DE); Calc: group
Comment 3 Telesto 2017-11-05 11:36:31 UTC
Repro with
4.2.0.4

No repro with
Versie 4.0.0.3 (Bouw-id: 7545bee9c2a0782548772a21bc84a9dcc583b89)
Comment 4 Telesto 2017-11-05 11:40:26 UTC
No repro with:
Versie: 4.1.0.4 
Build ID: 89ea49ddacd9aa532507cbf852f2bb22b1ace28
Comment 5 Telesto 2017-11-06 09:02:54 UTC
Created attachment 137560 [details]
Bibisect log

I bisected it on Linux to following commit based on the memory usage

commit 2e5167528f7566dd9b000e50fc1610b7bf99132a
Author:     Armin Le Grand <alg@apache.org>
AuthorDate: Thu Oct 31 14:43:21 2013 +0000
Commit:     Caolán McNamara <caolanm@redhat.com>
CommitDate: Tue Nov 5 15:24:18 2013 +0000
    
Resolves: #i123500# unified Graphic processing to use GraphicPrimitive2D

(cherry picked from commit f5d69b2b8b002ca6905496a9d9065ef76b5641d7)
Comment 6 Telesto 2017-11-06 09:04:28 UTC
Adding CC to Armin Le Grand
Comment 7 Telesto 2018-02-14 15:45:42 UTC

*** This bug has been marked as a duplicate of bug 80659 ***
Comment 8 Telesto 2018-08-14 18:05:41 UTC
Bug 80659 doesn't seem appropriate
Comment 9 Telesto 2018-08-14 18:06:55 UTC
*** Bug 104296 has been marked as a duplicate of this bug. ***
Comment 10 Ole Tange 2019-02-05 14:02:43 UTC
Problem is still in present in:

Version: 6.1.3.2 (x64)
Build ID: 86daf60bf00efa86ad547e59e09d6bb77c699acb
CPU tråde: 4; Styresystem: Windows 10.0; Gengiver af brugergrænseflade: Standard; 
Lokalisering: da-DK (da_DK); Calc: CL
Comment 11 Telesto 2019-03-25 10:39:55 UTC
Reasonable speed, but lots of processing in the background while typing (with only the single image around). So still repro:
Version: 6.3.0.0.alpha0+
Build ID: 20ea90a557b5bc744fd234e3a20ab1db484cf88b
CPU threads: 4; OS: Windows 6.3; UI render: default; VCL: win; 
TinderBox: Win-x86@42, Branch:master, Time: 2019-03-22_03:21:58
Locale: nl-NL (nl_NL); UI-Language: en-US
Calc: threaded
Comment 12 Telesto 2021-03-09 18:12:21 UTC
This is solved with Skia
Version: 7.2.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: dc3b64dcbfb0a49c0be65bd8d73ed4e6d3828a21
CPU threads: 4; OS: Windows 6.3 Build 9600; UI render: Skia/Raster; VCL: win
Locale: nl-NL (nl_NL); UI: nl-NL
Calc: CL
Comment 13 Xisco Faulí 2021-03-09 20:42:11 UTC
(In reply to Telesto from comment #12)
> This is solved with Skia
> Version: 7.2.0.0.alpha0+ (x64) / LibreOffice Community
> Build ID: dc3b64dcbfb0a49c0be65bd8d73ed4e6d3828a21
> CPU threads: 4; OS: Windows 6.3 Build 9600; UI render: Skia/Raster; VCL: win
> Locale: nl-NL (nl_NL); UI: nl-NL
> Calc: CL

Hi Telesto,
What about without SKIA? This bug was reported when SKIA wasn't implemented in LibreOffice
Comment 14 Telesto 2021-03-10 07:35:34 UTC
(In reply to Xisco Faulí from comment #13)
> (In reply to Telesto from comment #12)
> > This is solved with Skia
> > Version: 7.2.0.0.alpha0+ (x64) / LibreOffice Community
> > Build ID: dc3b64dcbfb0a49c0be65bd8d73ed4e6d3828a21
> > CPU threads: 4; OS: Windows 6.3 Build 9600; UI render: Skia/Raster; VCL: win
> > Locale: nl-NL (nl_NL); UI: nl-NL
> > Calc: CL
> 
> Hi Telesto,
> What about without SKIA? This bug was reported when SKIA wasn't implemented
> in LibreOffice

Presumably not, however GDI is pretty much unsupported. Should be phased out eventually (I requested that already, but Luboš Luňák preferred to keep it for a while.

So the only thing which remains the Linux backends and MacOS. However I haven't checked my Skia image perf reports against other backends either (which ideally should be done). 

In my ideal world I prefer one or maybe 2 backends. This would make reporting and fixing less complex. However needs an upfront investment to get Skia on those systems too.. and currently no budget :-(
Comment 15 Xisco Faulí 2021-03-10 08:07:16 UTC
(In reply to Telesto from comment #14)
> (In reply to Xisco Faulí from comment #13)
> > (In reply to Telesto from comment #12)
> > > This is solved with Skia
> > > Version: 7.2.0.0.alpha0+ (x64) / LibreOffice Community
> > > Build ID: dc3b64dcbfb0a49c0be65bd8d73ed4e6d3828a21
> > > CPU threads: 4; OS: Windows 6.3 Build 9600; UI render: Skia/Raster; VCL: win
> > > Locale: nl-NL (nl_NL); UI: nl-NL
> > > Calc: CL
> > 
> > Hi Telesto,
> > What about without SKIA? This bug was reported when SKIA wasn't implemented
> > in LibreOffice
> 
> Presumably not, however GDI is pretty much unsupported. Should be phased out
> eventually (I requested that already, but Luboš Luňák preferred to keep it
> for a while.
> 
> So the only thing which remains the Linux backends and MacOS. However I
> haven't checked my Skia image perf reports against other backends either
> (which ideally should be done). 
> 
> In my ideal world I prefer one or maybe 2 backends. This would make
> reporting and fixing less complex. However needs an upfront investment to
> get Skia on those systems too.. and currently no budget :-(

The question is not about whether it's supported or not, or which one is your preference. I don't think you should close a bug happening in GDI when you are using SKIA because the bug is not about SKIA, it's about GDI. OTOH, if you test it with GDI and the issue is gone, then you can close it.
Comment 16 Telesto 2021-03-10 09:55:38 UTC
@Luboš Luňák
Any outlook what QA should do with GDI bugs. I assume GDI will be deprecated pretty soon. So if I stubble on a bug. test it, and it's working with Skia, I see no problem anymore, resulting in WFM... but apparently slightly to eagerly 


(In reply to Xisco Faulí from comment #15)
> The question is not about whether it's supported or not, or which one is
> your preference. I don't think you should close a bug happening in GDI when
> you are using SKIA because the bug is not about SKIA, it's about GDI. OTOH,
> if you test it with GDI and the issue is gone, then you can close it.
Comment 17 Luboš Luňák 2021-03-10 11:43:16 UTC
The way I see it:
- GDI is AFAIK practically unmaintained, so it may perhaps get fixes, but unlikely to get improvements, and is possibly to be removed somewhen in the future when Skia is deemed stable and tested enough
- this is an improvement, relatively corner case and simple to work around ('Compress..' in the context menu to make the image a reasonable size)
- Skia often performs differently from all the other backends (being new, well tested, optimized, whatnot), so GDI bugs should be tested with some non-Skia backend to determine whether they are GDI-only bugs or non-Skia bugs

In this specific case I'd assume this is non-Skia, but if it's GDI-only, then it's unlikely to ever get fixed (other than by GDI getting removed).
Comment 18 Roman Kuznetsov 2021-12-07 14:24:11 UTC
I do not see any problems in

Version: 7.4.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: 3a61cce54277fd12570103a191c50d9b37ef3dd3
CPU threads: 8; OS: Windows 10.0 Build 19043; UI render: Skia/Raster; VCL: win
Locale: ru-RU (ru_RU); UI: ru-RU
Calc: threaded

Closed as WFM because LO now uses SKIA by default (and uses Raster mode anyway)