[ 
https://issues.apache.org/jira/browse/PDFBOX-4883?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17135228#comment-17135228
 ] 

Alfred edited comment on PDFBOX-4883 at 6/14/20, 4:45 PM:
----------------------------------------------------------

I am not sure I understood the code correctly.
 I think we are trying to keep COSFloat between +/-MIN_NORMAL and +/-MAX_VALUE 
all the time.

At the same time, we have a COSFloat.doubleValue()

In PDFBox, .doubleValue() is used only in tests.

The Preflight project uses .doubleValue(), but only to compare it with 
+/-32767f 
 A float is enough for that comparison, no need for a double.

Apart form that, doubleValue is not used anywhere.

Does PDF processing require more precision that we can get from a float?


was (Author: faltiska):
I am not sure I understood the code correctly.
I think we are trying to keep COSFloat between +/-MIN_NORMAL and +/-MAX_VALUE 
all the time.



At the same time, we have a COSFloat.doubleValue 

DoubleValue is used which is used only in tests in PDFBox.

 The Preflight project uses doubleValue, but only to compare it with +/-32767f 
A float is enough for that comparison, no need for a double.

Apart form that, doubleValue is not used anywhere.

Does PDF processing require more precision that we can get from a float?

> COSFloat is extremely slow
> --------------------------
>
>                 Key: PDFBOX-4883
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-4883
>             Project: PDFBox
>          Issue Type: Bug
>          Components: PDModel
>    Affects Versions: 2.0.20, 3.0.0 PDFBox
>            Reporter: Alfred
>            Assignee: Andreas Lehmkühler
>            Priority: Major
>              Labels: display, optimization, parsing, textextraction
>         Attachments: After.png, Before.png, PDFBOX-4883.patch
>
>
> I am testing text extraction from PDF and profiling the execution.
> I found that biggest time consumer is the COSFloat class.
>  
> All other improvements I suggested so far are small compared to this.
> But this is the also the most complex one.
>  
> I have attached te profiler output for the same text extraction, with and 
> without the COSFloat changes.
> The time to extract the same text was 4 times long with the original COSFlow, 
> because of its use of BigDecimal.
> I will try to write extra tests for all cases I see in the original COSFLoat 
> code, if they are not already tested.
> Then I will submit for review a new COSFloat version.
>  
> I think this affects parsing and displaying PDFs too, not just text 
> extraction.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to