[Solved] How to disable screen refresh - redrawing

Creating a macro - Writing a Script - Using the API (OpenOffice Basic, Python, BeanShell, JavaScript)
Post Reply
ptsenter
Posts: 22
Joined: Thu Feb 21, 2008 9:02 pm

[Solved] How to disable screen refresh - redrawing

Post by ptsenter »

Hi,
I have to insert 4+ million numbers into a spreadsheet. Right now I use setValue. It works, but takes hours (actually, 20+). My guess is the main reason calc redraws screen after each insert. Is it possible to disable redrawing and make refresh by request only, e.g., redraw after 1000 numbers only. It seems I saw similar question already, but cannot find it any more.
Thank you.
Last edited by ptsenter on Thu May 29, 2008 6:29 am, edited 1 time in total.
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: How to disable screen refresh - redrawing

Post by Villeroy »

Every API-call costs a lot of time. Use range.setDataArray(aRows(aColumns()))
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
ptsenter
Posts: 22
Joined: Thu Feb 21, 2008 9:02 pm

Re: How to disable screen refresh - redrawing

Post by ptsenter »

Thank you for your suggestion - it definitely works: even on a small matrix 20x120 copying one row as a single range gives me 6 - 10 times improvement.
But it turned out we have a much bigger problem: calc cannot handle spreadsheet that huge properly - it becomes slow or completely unresponsive. We have to do some preprocessing before moving data to spreadsheet and losing some flexibility. Oh, well.
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: [Solved]How to disable screen refresh - redrawing

Post by Villeroy »

Without knowing anything about your concrete problem. Could it be that you are implementing a database in a spreadsheet? Do you have many thousands of lookups?
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
ptsenter
Posts: 22
Joined: Thu Feb 21, 2008 9:02 pm

Re: [Solved] How to disable screen refresh - redrawing

Post by ptsenter »

There is no database and no executable code yet, just holding numbers (double) - at the moment 3 million, in production it might go up to 15 mil.
ms777
Volunteer
Posts: 177
Joined: Mon Oct 08, 2007 1:33 am

Re: [Solved] How to disable screen refresh - redrawing

Post by ms777 »

My recommendation: do not even try to use caalc for 15 mio numbers. Use base.
User avatar
probe1
Volunteer
Posts: 277
Joined: Mon Oct 08, 2007 1:34 am
Location: Chonburi Thailand

Re: [Solved] How to disable screen refresh - redrawing

Post by probe1 »

ms777,
have you tried Base with millions of records?

I have done so with some thousands
I would use a real DBMS.
Cheers
Winfried

DateTime2 extension: insert date, time or timestamp, formatted to your needs
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: [Solved] How to disable screen refresh - redrawing

Post by Villeroy »

probe1 wrote:ms777,
have you tried Base with millions of records?

I have done so with some thousands
I would use a real DBMS.
Thank you, you saved me some time and a "killall soffice.bin"
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Post Reply