GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — Add opt-in streaming (SXSSF) Excel write by mathiasmuller4sh · Pull Request #23 · 4sh/retable Conversation
Collaborator
WhyExcel writes always build the whole workbook in memory ( WhatNew opt-in options on
Applies to Changes needed to support SXSSF:
Two small fixes found along the way:
Tests
Full suite: 58 tests, all passing (JDK 11). Memory check, 200,000 rows x 6 columns, test JVM limited to 256 MB of heap:
Not in this PR
🤖 Generated with Claude Code
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactionsNew ExcelReadOptions.useStreamingWorkbook / streamingRowAccessWindowSize write xlsx with POI SXSSFWorkbook, keeping only a window of rows in memory instead of the whole workbook. Default behaviour is unchanged. - write path uses ss.usermodel interfaces instead of XSSF classes - track columns for POI autosize on streaming sheets - hidden constraints sheet written row by row (required by SXSSF) - fix faster autosize on empty records (empty sequence reduce) - don't collect column lengths when using POI autosize Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice, well-scoped change: opt-in, default path untouched, Two points I'd like addressed or at least documented before merging (hyperlinks still kept in memory, out-of-order records failing depending on the window size), plus a few minor remarks inline. Agreed on keeping the
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hyperlinks are not streamed. In POI 5.2.3 Could you mention it here, and say whether the 200,000-row memory check included a URL column? If it did not, it would be worth re-running it with one.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Documented in 03a443f (README +
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Out-of-order records fail depending on the window size. In classic mode, Suggestion: track the last written row index in
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed in b3efe65: in streaming mode any out of order record now fails right away with an explicit
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Minor: this is not fully source compatible, the return type changes from fun <S : Sheet> S.withValueConstraints(options: ExcelReadOptions, columns: RetableColumns): S {
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed in c611892 with
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Minor: adding constructor parameters changes the synthetic (Nit: write options living in
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not changed in code: to be mentioned in the release notes (compiled callers of
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Suggestion: SXSSF temp files are written uncompressed to
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added an opt-in
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit: the intent (forcing the lazy sequence so rows get written) is a bit hidden behind an empty
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Comment reworded in b2a1f3a.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit: this only checks that some width was set. Comparing column widths between
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done in f787a30: widths are now compared with the classic export (they match within 1/256 of a character, POI rounds slightly differently in SXSSF). Also added a test checking SXSSF temp files exist while writing and are deleted afterwards.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactionsPOI only fails on an out of order row once the previous one has been flushed to disk, so the error depended on the data volume. Fail on any out of order record instead, with an explicit message. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> POI SXSSF keeps every hyperlink on the backing XSSFSheet until the workbook is written, so memory still grows with URL columns. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Generic receiver so that callers passing an XSSFSheet still get an XSSFSheet back (source compatible with the previous signature; the JVM signature still changes since S erases to Sheet). Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> SXSSF temporary files are written uncompressed to java.io.tmpdir, which can become the next limit on large exports in containers with little disk space. Opt-in gzip compression, at the cost of some CPU. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> - compare POI autosize widths of the streaming export with the classic one instead of only checking a width was set - check SXSSF temporary files exist while writing and are deleted after Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> columns.list() goes through Kotlin reflection; calling it for each record cost about 25% of the streaming write time (200,000 rows: 3.97 s -> 3.03 s). Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> - non-regression: same cells/styles in classic and streaming, inline and sheet based value constraints, temp files deleted on failure, line number gaps, window of 1, empty export, classic reordering, faster autosize widths - performance: new perfTest task (256 MB heap, tag "perf", excluded from test) covering 200,000 rows, POI autosize, hyperlinks, streaming vs classic and compressed temp files Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Collaborator
Author
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ReviewersUh oh!
There was an error while loading. Please reload this page. AssigneesNo one assignedLabels
None yet
ProjectsMilestoneNo milestoneDevelopmentSuccessfully merging this pull request may close these issues. Uh oh!
There was an error while loading. Please reload this page. Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |