Bug 77346

Summary: FORMATTING: Calc becomes slow after selecting cells and activating font chooser with previews enabled (summary: comment 29)
Product: LibreOffice Reporter: Ryan Tandy <ryan>
Component: SpreadsheetAssignee: Not Assigned <libreoffice-bugs>
Status: NEW --- QA Contact:
Severity: normal    
Priority: medium CC: barta, cno, fdbugs, gitzu, jmadero.dev, nopower
Version: 4.2.0.4 releaseKeywords: bisected, regression
Hardware: Other   
OS: Linux (All)   
See Also: https://bugs.freedesktop.org/show_bug.cgi?id=80429
https://bugs.freedesktop.org/show_bug.cgi?id=80356
Whiteboard: BSA bibisected
i915 platform: i915 features:
Attachments: Test file
Video capture from 4.4.0.2

Description Ryan Tandy 2014-04-11 22:22:49 UTC
Problem description: 

Since 4.2, Calc becomes very slow after selecting some cells and activating the font chooser (for example to pick a font from the dropdown, or to type a font name). Verified on 4.2.3~rc3 under Ubuntu 12.04, Ubuntu 14.04, and Windows 7. Not tested on master yet, will do as soon as I have time.

The effect increases with the size of the spreadsheet and the number of cells selected. In a spreadsheet with 200 rows and 15 columns, after doing Select All and opening the font dropdown, any operation like moving the cursor to another cell or selecting some rows makes Calc stop responding (taking 100% cpu) for seconds or even minutes. In a 26x26 spreadsheet (just a-z in rows and columns) it's less severe but still noticeable.

Changing the font size doesn't trigger it.

If I disable "Show preview of fonts" (Options - LibreOffice - View), it doesn't happen any more after quitting Calc and starting it again. (The option is enabled by default.)

Bibisect points to bcc51fb2ebdf77a1cc089857775fd742085b45b6 ("add support for in-place style preview") as the first bad commit.
Operating System: Ubuntu
Version: 4.2.0.4 release
Comment 1 yagolf 2014-04-17 13:29:30 UTC
I can confirm this bug also on LibreOffice 4.2.1.1 under Windows 8.1 and Ubuntu Gnome 13.04

If I may, I'm of the opinion that the problem permeates deeper than just fonts formatting because doing about anything that involves Select > All slows down Calc to the point where it is becoming questionable whether it's really ready for production.
Comment 2 Ryan Tandy 2014-05-06 22:42:45 UTC
Since yagolf confirmed the bug (thanks!), changing from UNCONFIRMED to NEW.
Comment 3 Kohei Yoshida (inactive) 2014-05-08 12:59:31 UTC
This needs to be re-verified with a more recent 4.2 build.
Comment 4 Ryan Tandy 2014-05-08 15:21:16 UTC
Hi Kohei,

The bug exists also in 4.2.4 RC2.
Comment 5 Kohei Yoshida (inactive) 2014-05-08 19:45:30 UTC
Try daily build.  Release build is not to be used for QA purposes.
Comment 6 Kohei Yoshida (inactive) 2014-05-08 19:46:05 UTC
Even better would be the latest from the 4.2 branch.
Comment 7 Ryan Tandy 2014-05-08 22:12:58 UTC
Confirmed with libreoffice-4.2 daily build: libreoffice-4-2~2014-05-08_00.21.04

Seems to be fixed in master daily build: master~2014-05-07_23.36.18

I will try to find the responsible commit. There is no bibisect repository for 4.3 yet, right?
Comment 8 Kohei Yoshida (inactive) 2014-05-09 00:45:00 UTC
Huh. Weird. I did backport (what I think to be) the fix to 4.2 a week or so ago.  As far as Calc is concerned, there isn't much difference between master and 4.2 branches.
Comment 9 Kohei Yoshida (inactive) 2014-05-09 01:01:47 UTC
(In reply to comment #7)

> I will try to find the responsible commit. There is no bibisect repository
> for 4.3 yet, right?

Actually I don't know enough about bibisect to answer this.  Sorry.  Joel and Bjoern may know.
Comment 10 Kohei Yoshida (inactive) 2014-05-09 01:07:52 UTC
This commit is what I suspected to be the fix.

http://cgit.freedesktop.org/libreoffice/core/commit/?h=libreoffice-4-2&id=9585ea8a3f10be60c42b671a07dfafd78f173e52

and it's already in the 4.2 branch.
Comment 11 Ryan Tandy 2014-05-12 17:24:10 UTC
Tested again with:

libreoffice-4-2~2014-05-12_10.48.12_LibreOfficeDev_4.2.5.0.0_Linux_x86-64_deb
master~2014-05-11_23.54.14_LibreOfficeDev_4.3.0.0.alpha1_Linux_x86-64_deb

Actually, I don't think it's fixed, either on libreoffice-4-2 or on master. I don't know why I wrote that before.

Easy to reproduce:

1. put some text in the first cell and copy-paste that to some rows and columns (e.g. 50x50)
2. select all, and change the font
3. scroll up and down

With style previews enabled, after the font has been changed, scrolling is slow and there's a visible delay while cells are redrawn.

With style previews disabled, scrolling is fast.
Comment 12 Ryan Tandy 2014-05-12 17:45:13 UTC
Reading #74555, I really do expect this to be a duplicate of it. It sounds exactly the same. But I checked carefully that I'm testing with a build that includes that change, and I'm definitely still experiencing the problem like I wrote in my previous comment.
Comment 13 Kohei Yoshida (inactive) 2014-05-12 18:28:02 UTC
Ok.  Then this is perhaps something else.
Comment 14 gitzu 2014-06-16 06:04:32 UTC
(In reply to comment #13)
> Ok.  Then this is perhaps something else.

Yes, in versiĆ³n 4.2.5.2 still persists.
Comment 15 gitzu 2014-06-16 06:27:07 UTC
Another way to reproduce it:
Edit->Select All
Ctrl-M  (Format->Clean Format)
Then arrow keys move slowly
Comment 16 gitzu 2014-06-16 06:42:59 UTC
I hope this help to  Kohei Yoshida in some way:
How recuperate speed after change font in all cells:
Simply go to combo box to change font and next press escape (with nothing selected)
Calc then return to full speed!
Comment 17 gitzu 2014-06-20 15:33:57 UTC
Still in libreoficce 4.3.0 RC1.
I suppose it's a flag not checked  when select all is applicated, because change font without select cells fix the speed of calc.
Comment 18 tommy27 2014-06-24 05:27:28 UTC
please take a look at Bug 80429 - Calc slows down when you select all cells and change font

it looks a very similar issue which I reproduced under Win7x64 in 4.2.x but not in 4.3.0.1.0+
Build ID: 52613b9b632721ebb5167a4d9529c242a0b907da
TinderBox: Win-x86@42, Branch:libreoffice-4-3, Time: 2014-06-23_07:41:56

@gitzu
can you retest with a more recent 4.3 build?
Comment 19 Cor Nouws 2014-06-25 10:51:32 UTC
The original report was against Calc < 4.2.5.x
I think this is just OK in 4.2.5 ad 4.3.0
See https://bugs.freedesktop.org/show_bug.cgi?id=80356#c2
Comment 20 tommy27 2014-06-25 11:04:29 UTC
Ok. let's mark this as RESOLVED WORKSFORME.

feel free to reopen if somebody still reproduces this on recent 4.2.x or 4.3.x builds
Comment 21 gitzu 2014-06-25 12:04:47 UTC
I want to try if really the bug was corrected in recent versions, but Windows 
installers in Nightly Builds don't install.
Example:  libo-43~2014-06-25_00.02.29_LibreOfficeDev_4.3.0.1.0_Win_x86.msi
Comment 22 tommy27 2014-06-25 12:57:59 UTC
bad news... please open a new report about that 4.3.x install issue
Comment 23 Ryan Tandy 2014-07-02 19:42:31 UTC
(In reply to comment #20)
> feel free to reopen if somebody still reproduces this on recent 4.2.x or
> 4.3.x builds

Reopening. Reproduced with:

Version: 4.2.6.0.0+
Build ID: 32eddb3f48fcea0a052401a8a5dc075c7847f1c5
TinderBox: Linux-rpm_deb-x86_64@46-TDF, Branch:libreoffice-4-2, Time: 2014-07-02_08:19:58

Version: 4.3.1.0.0+
Build ID: c482a2f87ef2a38d249c276924e071bbc714a07f
TinderBox: Linux-rpm_deb-x86_64@46-TDF, Branch:libreoffice-4-3, Time: 2014-07-01_23:55:39

on Ubuntu 14.04 64-bit.

(In reply to comment #19)
> See https://bugs.freedesktop.org/show_bug.cgi?id=80356#c2

I agree with that comment. It is better than it was but there is still a noticeable loss of performance after opening the font chooser, when previews are enabled.

I think bug 80356 is a duplicate of this one (or vice versa), and both are a continuation of the issue that was partly fixed in bug 74555 and still partly exists.
Comment 24 Dmitry 2014-10-01 13:56:23 UTC
confirm this bug.

tested with LibreOffice_4.2.4_Win_x86.msi on windows xp,
libreoffice-bin-4.2.3.3 and libreoffice-bin-4.2.6.3 on gentoo linux.

disable "Show preview of fonts" solves problem.
Comment 25 Joel Madero 2014-11-06 22:50:02 UTC
Needs independent confirmation from QA team - moving to UNCONFIRMED. Thanks all
Comment 26 Cor Nouws 2014-11-07 13:41:11 UTC
On Linux, Ubuntu, 32 bits
4.2.7.2, 4.3.3.2, 4.4.0.alpha1
font preview activated

create a spreadsheet
select A1:T20000
or A1:Y20000

open font drop down
choose font
close drop down, open and chose another front
and some more

I experience no delay..
Comment 27 gitzu 2014-11-07 20:08:33 UTC
On Windows 7, 32 bits
4.3.3.2
font preview activated

create a spreadsheet
select A1:T20000  *** FILL IT *** with aleatory content

open font drop down
choose font
Navigate...

I experience delay..
Comment 28 Matthew Francis 2015-01-20 04:07:26 UTC
Created attachment 112513 [details]
Test file
Comment 29 Matthew Francis 2015-01-20 05:57:15 UTC
There is still an issue present in at least 4.4.0.2 and 4.5 master which does appear to date back to the range mentioned in comment 0 (which in the 43all bibisect repo is source-hash-bcc51fb2ebdf77a1cc089857775fd742085b45b6).

Steps to reproduce:
1. Load the file from attachment 112513 [details]
2. Ensure "Tools - Options - LibreOffice - View - Font Lists - Show preview of fonts" is enabled
3. Select All
4. Change to another font

Expected result:
- Interface should be as responsive as before (4) - e.g. scrolling, clicking between cells, selecting a cell range

Actual result:
- Interface is much slower than before. Saving and reloading the file resets the speed to normal
Comment 30 Matthew Francis 2015-01-20 06:04:40 UTC
Created attachment 112516 [details]
Video capture from 4.4.0.2

The attached video capture shows the observed effect. Note that after font preview is enabled and the font changed, the selection is much less responsive.

This effect is much more pronounced on a dbgutil build of 4.5 master (it hasn't become slower; this just seems to be a side effect of dbgutil)
Comment 31 Matthew Francis 2015-01-20 07:27:44 UTC
commit bcc51fb2ebdf77a1cc089857775fd742085b45b6
Building from source confirms that the slowdown started at the below commit

Adding Cc: to nopower@novell.com; Could you possibly take a look at this? Thanks


Author: Noel Power <noel.power@suse.com>
Date:   Thu Aug 29 17:15:33 2013 +0100

    add support for in-place style preview
    
    selecting a style in the styles dialog ( without double clicking )
    will apply the style to the currently selected cell(s) You can
    with the keys navigate to other styles and they in turn will
    also be applied. Preview will end when you click back onto the
    document.
    
    *FIXME* - the styles dialog isn't really suitable for previewing, a
    new dialog ( possibly in the toolbar ) might be nicer ( see Excel )
    
    *FIXME* - when there is a multiple selection the highlight colour
    (applied as a transparent overlay) is most annoying ( and is mixed
    with any background colour applied if part of a style )
    see ( ScGridWindow::UpdateSelectionOverlay() ) However my puny
    attempts to make the selection use a transparent colour made all the
    borders of the selected cells dissappear. I guess maybe a box/border
     around each selected cell ( or group of cells ) would also work
    but I didn't try that
    
    Change-Id: I0950e79085ffb75f60ee961835665df0c230172f

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.