RFR: 8304020: Speed up test/jdk/java/util/zip/ZipFile/TestTooManyEntries.java and clarify its purpose [v2]
Eirik Bjorsnos
duke at openjdk.org
Sun Mar 12 09:48:04 UTC 2023
> Please review this PR which speeds up TestTooManyEntries and clarifies its purpose:
>
> - The name 'TestTooManyEntries' does not clearly convey the purpose of the test. What is tested here is the validation that the total CEN size fits in a Java byte array. Suggested rename: CenSizeTooLarge
> - The test creates DEFLATED entries which incurs zlib costs and File Data / Data Descriptors for no additional benefit. We can use STORED instead.
> - The name of entries is generated by calling UUID.randomUUID, we could use simple counter instead.
> - The produced file is unnecessarily large. We know how large a CEN entry is, let's take advantage of that to create a file with the minimal size.
> - The summary and comments of the test can be improved to help explain the purpose of the test and how we reach the limit being tested.
>
> These speedups reduced the runtime from 6 min 58 sec to 3 min 35 sec on my Macbook Pro. The produced ZIP size was reduced from 6000000098 bytes to 3655383762 bytes.
Eirik Bjorsnos has updated the pull request incrementally with one additional commit since the last revision:
Set modification time using ZipEntry.setLocalTime avoids the default time calculation
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/12991/files
- new: https://git.openjdk.org/jdk/pull/12991/files/864b93b3..e1425614
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=12991&range=01
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=12991&range=00-01
Stats: 4 lines in 1 file changed: 4 ins; 0 del; 0 mod
Patch: https://git.openjdk.org/jdk/pull/12991.diff
Fetch: git fetch https://git.openjdk.org/jdk pull/12991/head:pull/12991
PR: https://git.openjdk.org/jdk/pull/12991
More information about the core-libs-dev
mailing list