https://bugs.documentfoundation.org/show_bug.cgi?id=164609

            Bug ID: 164609
           Summary: librecalc does not multithreading
           Product: LibreOffice
           Version: 25.8.0.0 alpha0+
          Hardware: x86-64 (AMD64)
                OS: Linux (All)
            Status: UNCONFIRMED
          Severity: normal
          Priority: medium
         Component: Calc
          Assignee: [email protected]
          Reporter: [email protected]

Created attachment 198398
  --> https://bugs.documentfoundation.org/attachment.cgi?id=198398&action=edit
Try to change in 1st sheet high energy to anything else. >10min, single core
100%

Version: 24.8.3.2 (X86_64) / LibreOffice Community
Build ID: 480(Build:2)
CPU threads: 24; OS: Linux 6.12; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
Debian package version: 4:24.8.3-3
Calc: threaded (yes, multithreded is activated from the menu.

ods sheet: https://file.io/RYFiIGrDQQ93 (until 20 jan2025)

----------------------------------------------------
Librecalc does not do real multithreading. 

Sheet description:
Yes, I have 3 intensive sheets. I characterize "Intensive sheets" that are not
simple "IF" calcs", but include calculations on arrays. My sheets almost are
full of INDEX(ARRAY, small(if(ARRAY=1, ROW(....)), row(....)). 

Therefore, aprroximately: such index(small(if)) calcs exist:
1st sheet) 90*1000  columns "data" sheet
2nd sheet) 350*1000 columns "prod_tbls" sheet
3rd sheet) 300*300  col*rows "tidt_tbl" sheet 
and transpose: 
4th sheet) 500*100  transpose "trnsp_tbl" sheet
"copy from here" - no intensive sheet (some simple ifs)

Note that all calculations are boxed into pink lines.Zoom out to find them.  
----------------------------------------------------
I did some experiments:
(1st attachment - replace,
2nd attachment saving)


a) Try to change in 1st sheet "high energy" to anything else with cntr+H. It
takes >5min. ONLY 1 core is active each time to 100%, BUT the number of core
that is going 100% is changing (some seconds can be the 1st, the 12th, the 5th
whatever). 
This is NO multithreading - this is changing what core is going 100% each time.

b) Try to save the calc. It is taking more than 3-4 minutes. The game with
cores is the same here too. No real multithreading.

For comparison, to compile from source pspp with "make" (single core) is taking
>10minutes. when using make -j (multithreading), the job is finished less than
1-2min. 

----------------------------------------------------
My thoughts - i am not a programmer 

I can understand that is hard to parallelize calcs that the output of one is
the input of the next one. All my calc formulas are SERIAL calcs. a->b->c->d
etc. How one can put one calcs for the 1st thread and another to the 3rd thread
while the output is unknown? 

a) cells alignments, colors, styles can be put on some threads eg. 1st,2nd, 3rd
b) When formula (is horizontal applied) is applied to an input of eg. 1000
rows, this can be broken eg. to 250+250+250+250 eg 4 independent threads.   
c) You can see in my sheets that while the formula is applied to 1000 rows, the
real data occupying in 1st sheet (data) ~400 rows, 2nd sheet 60 rows. So, a lot
of calculations can be saved, if it is predicted that will exists "null data". 

My case maybe is special, but i think intensive formulas maybe 90% of cases
will be SERIAL formulas, either horizontally, or vertically. Mixed designs, or
complex designs must be more rare i think. 

However, i think you may design all relevant scenarios and decide in each case
how calcs can be broken down for multithreading. 

have a happy year!
----------------------------------------------------

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to