Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

performance of internal jzlib implementation #691

Closed
mjmst74 opened this issue Oct 25, 2024 · 4 comments
Closed

performance of internal jzlib implementation #691

mjmst74 opened this issue Oct 25, 2024 · 4 comments
Milestone

Comments

@mjmst74
Copy link
Contributor

mjmst74 commented Oct 25, 2024

I ran into an issue with JSch 0.2.19, running on OpenJDK 17.0.12 on RHEL 8, where file transfers were taking much longer than expected, with compression set to 6.

For example, I was seeing a 29mb file take 45 seconds to transfer. (This was both with the new JSch 0.2.19 default algorithms, and with the configuration updated to use older algorithms that were defaults in JSch 0.1.55.)

With no compression, a 41mb file took 931 ms to transfer.

Switching to com.jcraft.jsch.juz.Compression, a 43mb file took 683 ms to transfer.

Out of curiousity, I dropped in the jzlib 1.1.3 classes and tried some transfers, and the times were as fast as expected - a 35mb file took 724 ms.

I don't have long-running benchmarks to share, but I did see consistent performance to the examples above over multiple file transfers.

I was wondering if this is expected behavior with the com.jcraft.jsch.jzlib implementation, or if its a possible issue that could be addressed?

@norrisjeremy
Copy link
Contributor

I'm not surprised in the least that the JZlib implementation is slower: it is implemented via pure Java, while the java.util.zip implementation is a JNI based wrapper around native Zlib library.

If compression support is important to you and you don't mind that the java.util.zip implementation is not technically compliant to the SSH RFC standards, then you probably will want to use it in preference to the JZlib implementation.

@mjmst74
Copy link
Contributor Author

mjmst74 commented Oct 25, 2024

Agreed, I'm not surprised that the JZlib implementation is slower - but I was surprised that the JZlib bundled with JSch is so much slower than the old JZlib 1.1.3.

@mjmst74
Copy link
Contributor Author

mjmst74 commented Oct 28, 2024

I believe I found the issue, PR submitted: #692

@cpfeiffer
Copy link

Since #692 is in, this issue can be closed as well, I suppose.

@mwiede mwiede added this to the 0.2.21 milestone Nov 26, 2024
@mwiede mwiede closed this as completed Nov 26, 2024
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

No branches or pull requests

4 participants