[Bug 63482] New: Application hang because of autoSizeColumn

classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|

[Bug 63482] New: Application hang because of autoSizeColumn

Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=63482

            Bug ID: 63482
           Summary: Application hang because of autoSizeColumn
           Product: POI
           Version: 4.0.0-FINAL
          Hardware: PC
            Status: NEW
          Severity: critical
          Priority: P2
         Component: XSSF
          Assignee: [hidden email]
          Reporter: [hidden email]
  Target Milestone: ---

I have a problem with autoSizeColumn with small number of columns and data.
I have an application which generates XLSX files in different threads.
I have changed the POI version from 3.17 to 4.1.0 and the application became to
hang on the autoSizeColumn(sheet, true) line.
When I had removed this line or had changed to sheet.setColumnWidth(i,
SMALL_COLUMN_WIDTH) the problem was resolved.

There aren't excpetions in the log file!


-----Versions-----

1) OS: Windows 10

2) Java
java version "11.0.3" 2019-04-16 LTS
Java(TM) SE Runtime Environment 18.9 (build 11.0.3+12-LTS)
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.3+12-LTS, mixed mode)

3)
POI version: 4.1.0

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 63482] Application hang because of autoSizeColumn

Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=63482

Vladimir <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 OS|                            |Windows 10

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 63482] Application hang because of autoSizeColumn

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=63482

Vladimir <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 OS|                            |All

--- Comment #1 from Vladimir <[hidden email]> ---
Small clarification: autoSizeColumn() works fine wit POI version 3.17 and Java
8

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 63482] Application hang because of autoSizeColumn

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=63482

Dominik Stadler <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |NEEDINFO

--- Comment #2 from Dominik Stadler <[hidden email]> ---
Can you provide a small sample application which reproduces the problem?
Without it is very hard to investigate such a bug-report.

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 63482] Application hang because of autoSizeColumn

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=63482

--- Comment #3 from Cody Lerum <[hidden email]> ---
I ran into this same issue today when making the move from Java 8 to Java 11
and from POI 3.17 to 4.1.0 and I've narrowed this down to a slowdown with Java
11. It doesn't matter if you are running 3.17 or 4.1.0

When running the simple reproducer (taken from the SSPerformanceTest) below
with POI 4.1.0


Elapsed 2.71 seconds for arguments [HSSF, 5000, 15, 1] on Java 1.8.0_212

Elapsed 35.08 seconds for arguments [HSSF, 5000, 15, 1] on Java 11.0.4

Elapsed 33.27 seconds for arguments [HSSF, 5000, 15, 1] on Java 12.0.1

The situation seems resolved in Java 13

Elapsed 3.44 seconds for arguments [HSSF, 5000, 15, 1] on Java 13


FYI this This is still an issue on the latest nightly pulled from AdoptOpenJDK:

Elapsed 37.13 seconds for arguments [HSSF, 5000, 15, 1] on Java 11.0.5

Commenting out the sheet.autoSizeColumn(i) yields:
Elapsed 0.54 seconds for arguments [HSSF, 5000, 15, 1] on Java 11.0.5



https://gist.github.com/codylerum/5e302c4cd69e133206ddde9e50f44daa

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 63482] Application hang because of autoSizeColumn

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=63482

Cody Lerum <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[hidden email]

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 63482] Application hang because of autoSizeColumn

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=63482

Axel Howind <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[hidden email]

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 63482] Application hang because of autoSizeColumn

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=63482

--- Comment #4 from None35 <[hidden email]> ---
Created attachment 36913
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=36913&action=edit
Snapshot of VisualVM CPU-profiling

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 63482] Application hang because of autoSizeColumn

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=63482

None35 <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEEDINFO                    |NEW

--- Comment #5 from None35 <[hidden email]> ---
I confirmed the problem.
It occured with POI-3.17 and POI-4.1.1 when it is used with Java 11.
With Java 8, there is no problem.

I've provided a snapshot of VisualVM CPU-profiling with POI-4.1.1 with both
JVM.
It's with a small sheet.

Sorry but I can't provide the application.

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 63482] Application hang because of autoSizeColumn

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=63482

None35 <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[hidden email]

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 63482] Application hang because of autoSizeColumn

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=63482

--- Comment #6 from [hidden email] ---
I can confirm the problem on Win10 + Java 11 + POI 4.1.1.

I created a small sample project which shows that on Java 8, an export of 2000
rows with 30 columns using SXSSF takes around 19 seconds while on Java 11 it
takes 2 minutes and 19 seconds.

As far as I can see, the difference comes from method
'org.apache.poi.ss.util.SheetUtil.getCellWidth(int, int, CellStyle, double,
AttributedString)', the call to 'new TextLayout(str.getIterator(),
fontRenderContext)' takes around 150,000 nanoseconds on Java 8 but around
1,180,000 nanoseconds on Java 11, almost 8 times as long.

Such an order of performance loss is critical on production environments where
much more rows are exported.

Is there anything expected on next release?

The small sample project should be available at
https://github.com/azmau/poi-perf

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 63482] Application hang because of autoSizeColumn

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=63482

[hidden email] changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[hidden email]

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 63482] Application hang because of autoSizeColumn

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=63482

--- Comment #7 from PJ Fanning <[hidden email]> ---
No rewrite of SheetUtil is currently planned. TextLayout is a JavaRuntime
class, not a POI class. Rewriting POI not to use TextLayout is a big
undertaking.

Does your profile say what the hotspot is inside `new TextLayout` - there is a
lot of code called by that constructor?

Have you tried other JREs - newer versions or later JRE/JDK implementations?

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]