LibreOffice Draw slow with pdf

I am using a workstation with 32gb 2400mhz ram, Xeon 8th gen 4-core processor and very fast samsung SSD.
I tried to open a 1 page PDF with Libreoffice Draw and it is so slow that it is almost unusable. Opening or saving the .odg document takes more than 5-6 seconds, moving around the page (via mouse or directional arrows) takes 1-2 seconds and it’s extremely laggy.
I tried to

  • put 2gb of Xmx and Xms memory in the java runtime environemnt
  • disable aliasing
  • increase caches size in Expert Configuration (basically x10 on each cache size and number of OLE objects)

the latter change made everything slightly faster but it is still terrible to use overall.

The page has 2 tables (built with lines), 2 small logos and some text.I tried to delete step by step the content and I reached some fluid navigation when I removed almost everything in the page but some text and lines.

This happens almost always when I open pdf files. Is there any known solution to avoid this or maybe removing some “buggy” components that slow everything down?

EDIT:
sorry I forgot to add more details because in my mind I assumed it was experienced by everyone since it happened for as long as I can remember.

I have arch kernel 4.19.12-2 and it happens both with

  • libreoffice-fresh (bleeding edge version) 6.1.3-2
  • libreoffice-still (stable version) 6.0.7-2

The file I am having issue with can be found here

Although you detail your amazing computer, you don’t comment anything about the OS and LibreOffice version, and maybe if you share some of those slows pdf, maybe someone can find what the issue is.

First of all, I want to reassure you - this problem is not related to the configuration of your computer. On my computer, your file is also being processed very slowly.

You can easily understand such a strange behavior of the program, if you put a simple experiment. Select any element on the page (for example, a logo), press the Tab key and see what is highlighted when the focus is moved. It turns out that there are many graphic elements on the page that are not visible - their color almost coincides with the background color, the eye cannot see them, but the computer spends a lot of resources to draw it.

Continue the analysis, click F5 and turn on the display of shapes. Just on the first page of your document almost 4,500 objects.

F5.png

This can happen if a document is created by some overly diligent OCR program.

How can you make a difference? For example, you can try to process a document with a macro like this:

Sub RemoveExcessTrash
Dim oDrawPages As Variant, oDrawPage As Variant, oElement As Variant
Dim i As Long, j As Long, nHeight As Long, nWidth As Long
Dim aSize As New com.sun.star.awt.Size
Dim sString As String
	oDrawPages = ThisComponent.getDrawPages()
	For i = oDrawPages.getCount()-1 To 0 Step -1
		oDrawPage = oDrawPages.getByIndex(i)
		For j = oDrawPage.getCount()-1 To 0 Step -1
			oElement = oDrawPage.getByIndex(j)
			aSize = oElement.getSize()
			nHeight = aSize.Height
			nWidth = aSize.Width
			sString = oElement.getString()
			If Trim(sString)="" And ((nHeight+nWidth < 1500) Or (nHeight*nWidth<6000)) Then oDrawPage.remove(oElement)
		Next j
	Next i
	Print "All done"
End Sub

This code just thoughtlessly removes all objects from the document that do not contain text and are not very large in size (the length of the half of perimeter and the size of area of ​​the figure are checked)

You will need to choose two constants empirically.

After such a rough processing, the document becomes not so heavy.

Thanks! I imagined it was something like that.
I hoped there was some way to remove the aggressive OCR, but being able to visualize all those useless shapes is already good. Thanks