Skip to content

Comments

Oops all Kotlin!#7

Closed
Wavesonics wants to merge 8 commits intoJojo4GH:masterfrom
Wavesonics:only-kotlin
Closed

Oops all Kotlin!#7
Wavesonics wants to merge 8 commits intoJojo4GH:masterfrom
Wavesonics:only-kotlin

Conversation

@Wavesonics
Copy link
Contributor

@Wavesonics Wavesonics commented Dec 28, 2025

Okay I realize this is a lot of PRs, but you can choose your own adventure here, they all stack on each other:

  1. Just add the iOS targets, I verified with some tests that they are good to go
  2. Take the iOS targets plus the tests ported over from Kuba, this also adds a CI task for github to run the tests
  3. Pure Kotlin Zip: This branch is mainly a demonstration, proving out that a pure Kotlin implementation is not only possible, but might actually be MORE performant!
  4. The whole hog: (this one) Removes all over the wrapper implementations

Updated to the latest headers fronm kuba
- Converted the C test suite from Kuba Zip to Kotlin
- Switched the JVM implementation to zip4j because the built in JVM implementation packed Append functionality. This allowed the JVM impl to pass the whole test suite
Added performance tests to compare it against the C implementation
1.
Streaming Read/Write: The implementation no longer loads the entire ZIP file or its entries into memory. It now uses a DataSource system to defer data access until the final write operation.
2.
Random Access Seeking: I implemented platform-specific random-access seeking (openSourceAt) for JVM (using RandomAccessFile) and Native (using fseek). This eliminated the $O(N^2)$ overhead caused by Source.skip, which previously read and discarded data from the start of the file for every entry.
3.
Optimized CRC32: Replaced the naive bit-by-bit CRC32 with a high-performance table-based implementation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant