Description: I have a word file which is more 300 pages.I build libreOffice for Android, I opened this file with libreOffice on Android, and it took 35 seconds from opening to documentLoaded. I compare it to other Android Office apps which take 1~2s to open and then dynamically render the next page, and you'll see the page number increase and load dynamically and The first View will be render. So I want to ask can LibreOffice optimize the opening speed of such files? It looks like the native method documentLoad() is taking too much time. Steps to Reproduce: Steps to Reproduce: 1.Use Android LibreOffice Viewer 2.Open many page(more 100 pages) file(doc,docx,ppt,pptx) Actual Results: from opening to documentLoaded took about 35 seconds.So Slow Expected Results: The loaded content is displayed first, and subsequent content is dynamically loaded.the method documentLoad() reduce the load time. Reproducible: Always User Profile Reset: Yes Additional Info: This file I'll upload to Google Drive. https://docs.google.com/document/d/1tKz3gvELS6U92EUHl8jAxFP2egFuHcQg/edit?usp=sharing&ouid=112436450903907951628&rtpof=true&sd=true
*** Bug 155811 has been marked as a duplicate of this bug. ***
I added two videos to compare. 1. LibreOffice Viewer(35s) https://drive.google.com/file/d/1TaBiTK4ySlyy7AEllA2PseRHX-B5rKlT/view?usp=sharing 2. TBS Demo(2s) https://drive.google.com/file/d/1gq9gRt02j-ugL8tHgZRsy2_uHCuQ9RyP/view?usp=sharing
Like the original number, I add gaps, but this time there are more of them. https://minicrossword.io
(In reply to featheredreflection from comment #3) > Like the original number, I add gaps, but this time there are more of them. > https://minicrossword.io I can't understand!
Anyone who can help?
Even in the desktop version of LibreOffice, this takes about 45 seconds for me to load, so might be a general performance topic, rather than something specific to the Android version. I'm therefore changing the component to Writer for now. (In reply to Xiaoc from comment #5) > Anyone who can help? Profiling where most of the time is spent might be a good first step.
Thanks for reply!I will try to debug for checking methods which consume much time.However, my Linux system currently does not have enough memory to build a successful debug version, so I also provide the word file, hope you analyze together!
(In reply to Xiaoc from comment #7) > [...] so I also provide the word file, hope you > analyze together! Thanks for looking into this. Unfortunately, I don't think I'll find the time to really look into this anytime soon.
*** Bug 157720 has been marked as a duplicate of this bug. ***
any progress for this?
(In reply to eric li from comment #10) > any progress for this? If you can help with a profiling from comment 6, there could be.
(In reply to BogdanB from comment #11) > (In reply to eric li from comment #10) > > any progress for this? > > If you can help with a profiling from comment 6, there could be. I went through the source code,,looks like every time Libreoffice would loaded and rendered all the pages of the file ,,that could be the major issue of this..How can we change it?
(In reply to eric li from comment #12) > I went through the source code,,looks like every time Libreoffice would > loaded and rendered all the pages of the file ,,that could be the major > issue of this..How can we change it? Are all pages actually rendered or is the loading of the document (parsing of the XML content etc.) what takes so much time? IIUC, the general idea is to only render what's necessary, so if rendering for all pages is done, maybe it's possible to only request rendering of (approximately) the part that's visible?
(In reply to Michael Weghorn from comment #13) > (In reply to eric li from comment #12) > > I went through the source code,,looks like every time Libreoffice would > > loaded and rendered all the pages of the file ,,that could be the major > > issue of this..How can we change it? > > Are all pages actually rendered or is the loading of the document (parsing > of the XML content etc.) what takes so much time? > IIUC, the general idea is to only render what's necessary, so if rendering > for all pages is done, maybe it's possible to only request rendering of > (approximately) the part that's visible? OKay,,pls let me know how to do this? it could be possiable to improve the open performance....btw,,if you have a file like 300Mbytes,500Mbytes..still take a lot time to load all content..I think it should be a way to read file head engouh ,and only load the necessary part of the files.. thanks
(In reply to Michael Weghorn from comment #13) > (In reply to eric li from comment #12) > > I went through the source code,,looks like every time Libreoffice would > > loaded and rendered all the pages of the file ,,that could be the major > > issue of this..How can we change it? > > Are all pages actually rendered or is the loading of the document (parsing > of the XML content etc.) what takes so much time? > IIUC, the general idea is to only render what's necessary, so if rendering > for all pages is done, maybe it's possible to only request rendering of > (approximately) the part that's visible? maybe it is not the rendering issue , as usually, normal GUI framwork rendering happens when load the right pages....when I checked the logs out public void resetParts(){ mContext.getDocumentPartView().clear(); if (mDocument.getDocumentType() != Document.DOCTYPE_TEXT) { int parts = mDocument.getParts(); for (int i = 0; i < parts; i++) { String partName = mDocument.getPartName(i); if (partName.isEmpty()) { partName = getGenericPartName(i); } Log.i(LOGTAG, "resetParts: " + partName); mDocument.setPart(i); resetDocumentSize(); final DocumentPartView partView = new DocumentPartView(i, partName); mContext.getDocumentPartView().add(partView); } } Log.i(LOGTAG, "resetParts: " + partName); this line was keeping generating the logs parname will increase,,So I guess the "part" means page...after the partname increased to the end page..the file started to be opened..
(In reply to Michael Weghorn from comment #13) > (In reply to eric li from comment #12) > > I went through the source code,,looks like every time Libreoffice would > > loaded and rendered all the pages of the file ,,that could be the major > > issue of this..How can we change it? > > Are all pages actually rendered or is the loading of the document (parsing > of the XML content etc.) what takes so much time? > IIUC, the general idea is to only render what's necessary, so if rendering > for all pages is done, maybe it's possible to only request rendering of > (approximately) the part that's visible? Hi,Michael I did more test Log.i(LOGTAG, "====> before load"); mDocument = mOffice.documentLoad( (new File(fileToBeEncoded.getParent(),encodedFileName)).getPath() ); Log.i(LOGTAG, "====> after load"); what I found is this completedly libreoffice C code issue,, below is the results 2023-11-23 01:17:54.536 29487-29735 LOKitTileProvider com.test.paper ====> before load 2023-11-23 01:18:23.315 29487-29735 LOKitTileProvider com.test.paper I ====> after load
(In reply to eric li from comment #16) > Hi,Michael I did more test > > Log.i(LOGTAG, "====> before load"); > mDocument = mOffice.documentLoad( > (new > File(fileToBeEncoded.getParent(),encodedFileName)).getPath() > ); > Log.i(LOGTAG, "====> after load"); > > what I found is this completedly libreoffice C code issue,, > below is the results > 2023-11-23 01:17:54.536 29487-29735 LOKitTileProvider com.test.paper > ====> before load > > 2023-11-23 01:18:23.315 29487-29735 LOKitTileProvider com.test.paper > I ====> after load Thanks a lot for the analysis. This seems to match what my comment 6 says about this being similarly slow in the desktop version. (Profiling with that one might be easier.)