Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 7B925200C6F for ; Tue, 9 May 2017 18:54:07 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 7A478160BCB; Tue, 9 May 2017 16:54:07 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id C7FD5160B9A for ; Tue, 9 May 2017 18:54:06 +0200 (CEST) Received: (qmail 19766 invoked by uid 500); 9 May 2017 16:54:06 -0000 Mailing-List: contact dev-help@poi.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "POI Developers List" Delivered-To: mailing list dev@poi.apache.org Received: (qmail 19746 invoked by uid 99); 9 May 2017 16:54:05 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 09 May 2017 16:54:05 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 6CF94C1055 for ; Tue, 9 May 2017 16:54:05 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -0.002 X-Spam-Level: X-Spam-Status: No, score=-0.002 tagged_above=-999 required=6.31 tests=[RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id alFtmQos988E for ; Tue, 9 May 2017 16:54:03 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id 73C1A5F36E for ; Tue, 9 May 2017 16:54:03 +0000 (UTC) Received: from asf-bz1-us-mid.priv.apache.org (nat1-us-mid.apache.org [23.253.172.122]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTPS id 18959E0630 for ; Tue, 9 May 2017 16:54:03 +0000 (UTC) Received: by asf-bz1-us-mid.priv.apache.org (ASF Mail Server at asf-bz1-us-mid.priv.apache.org, from userid 33) id 3155560D4F; Tue, 9 May 2017 16:54:01 +0000 (UTC) From: bugzilla@apache.org To: dev@poi.apache.org Subject: [Bug 60397] very slow Cell Merge for SXSSFWorkbook Date: Tue, 09 May 2017 16:54:01 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: POI X-Bugzilla-Component: SXSSF X-Bugzilla-Version: 3.15-FINAL X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: stephen.webster@inetsoft.com X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: dev@poi.apache.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_status Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bz.apache.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 archived-at: Tue, 09 May 2017 16:54:07 -0000 https://bz.apache.org/bugzilla/show_bug.cgi?id=3D60397 Stephen Webster changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEEDINFO |NEW --- Comment #5 from Stephen Webster --- I have been watching this bug, and wanted to add some information that I ha= ve gathered since I didn't see any progress. Here is my testcase. for(int i=3D0; i < 20000; i++) { for(int j=3D0; j < 30; j+=3D3) { CellRangeAddress range =3D new CellRangeAddress(i,i,j,j+2); sheet.addMergedRegionUnsafe(range); } } The results get quite a bit worse as the number of rows/merged region number increases. 1000 rows -> 1.2 seconds 10000 rows -> 100 seconds 20000 rows -> Over 5 minutes. I dropped the above code and profiled it and turns out the time spent is in= the return statement of addMergedRegion(), ctMergeCells.sizeOfMergeCellArray(); I am not using the return value of this method, after creating a locally modified version of the XSSFSheet class, I created a method without the ret= urn statement and the testcase finishes in less then 1 second instead of over 5 minutes for 20,000 rows. Here is the stack from profiler which was 90% of time spent Stack Trace org.apache.xmlbeans.impl.store.Locale.count(Xobj, QName, QNameSet) org.apache.xmlbeans.impl.store.Xobj.count_elements(QName)=20=20=20=20=20=20= =20 org.openxmlformats.schemas.spreadsheetml.x2006.main.impl.CTMergeCellsImpl.s= izeOfMergeCellArray() org.apache.poi.xssf.usermodel.XSSFSheet.addMergedRegion(CellRangeAddress, boolean) org.apache.poi.xssf.usermodel.XSSFSheet.addMergedRegionUnsafe(CellRangeAddr= ess) --=20 You are receiving this mail because: You are the assignee for the bug.= --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org For additional commands, e-mail: dev-help@poi.apache.org