How Do I Increase CPU Utilization In Calc

I have a spread sheet in Calc with over 40,000 lines with data in cells 24 across. After adding newlines, I do a sort and then use a macro to identify and mark lines that have duplicate values in the cells in one column. I then use a filter to isolate those duplicated lines and delete those lines using Sheet/Delete Rows. There are often 500 duplicate lines unevenly distributed and it takes over 10 minutes for the deletion to be accomplished. One thing I have noticed is that during this time, the CPU utilization averages only 25%. Since I am only twiddling my thumbs waiting for the deletion process to finish, is it possible to increase the CPU utilization to accomplish the task in a shorter amount of time? I really do not care if any other process is affected negatively.

Edit:
OS: Windows 7 LibreOffice: 6.4.2.2 (x64)

Edit 2:
Version: 6.4.2.2 (x64)
CPU threads: 4
OS: Windows 6.1 Service Pack 1 Build 7601
UI render: GL
VCL: win;
Locale: en-US (en_US)
UI-Language: en-US
Calc: CL

Please edit your question and add the information in Menu/Help/About LibreOffice, to see what is your configuration.

You never can do such thing on a application level but on an operating system level (e.g on Linux you could use the renice command to alter the priority of a process, but you don’t mention you operating system).

I have been using Slackware on servers since the mid 90s so I am familiar with renice but alas my desktop is still on Windows 7 and that probably won’t change until I run into the lack of a compatible driver for a new peripheral. I was just hoping for a magic cure since it seems rather foolish to throttle a foreground process to 25% of the available processor cycles while keeping the other 75% doing nothing or in reserve.
Thanks for commenting.

I’m going to bet the culprit is in the macro(s).
Any chance you could dump the data and share the workbook here with the macro so that folks could take a look?

All the information in Menu/Help/About LibreOffice is needed to know if for calc, OpenCL and Multi-Threaded calculation are enable, although as Drew comment surely slowness is in relation with the macro.

@mariosv
I hope I have added the information you were looking for in the original question. Also, so you can better consider the times in the next paragraph, the computer is a white box I put together circa 2016. It has an Intel i5-7600 @3.5 GHz CPU, 16 GB of RAM, and an Asus B250M-C mother board.

@Drew1 Jensen
Before I go to the trouble of trying to sanitize the macro, I wonder if it is really part of the problem. The macros are only used prior to the deletion of the rows with duplicate data in the cells of one column. A macro is not used to delete the rows.

As a test, I did everything up to the point of the deletion and then saved the file. I did not have as much new data to add as I normally add, but it was enough to produce 176 rows that needed to be deleted. Manually selecting Sheet/Delete Rows, it took 4 minutes and 19 seconds to the delete the rows. After closing the file without saving, I opened the file that I had saved previously, deleted all the custom macro modules (2), and repeated the manual deletion. This time it took 4 minutes 15 seconds. I am not sure why it was 4 seconds faster without the macros but on the off chance it has to with the macros, I doubt if rewriting them will help.

WOW - so I tried this with a file here; Linux, AMD 4 core, 8 gig ram. (and I left a number of CPU intensive BOINC jobs running in the background)

Calc file with a sheet of ~57,000 rows x 39 columns
Lots of array functions in that sheet
The slowest part was the sort and that was less then a minute
The delete of 500 rows takes only a few seconds.
I didn’t set any filters, IDK maybe that is a factor

EDIT - one thing I noticed i that after the sort I had a bunch of DIV errors - because I suppose the sheet was automatically recalculating and some of the array functions got messed up with me willy nilly sorting on random columns. What I didn’t do and I wish I had was to turn off auto recalculate before doing the sort and delte ; don’t know if that might help, but if the sheet isn’t calculation heavy it probably wouldn’t

not going to the details of the intended deletions, my experience with win task manager (win7-64):
cpu usage is limited to the ‘per core fraction’ of 100 percent (~12,5% on a 8 core machine) while not activating ‘threaded’ (but as well threaded as ‘openCL’ bear the risk of unnoticed calculation errors (ctrl-shift-F9 helps out)), linux opposite shows 100% - with ‘top’ - and sometimes more than that with other processes or threaded active, thus to get better values shown use linux or buy a machine with less cpu cores :wink: