Giter Site home page Giter Site logo

Comments (5)

puellanivis avatar puellanivis commented on May 24, 2024

Are you using UseConcurrentReads and UseConcurrentWrites ?

How come a compiled code is even slower than a interpreting code?

Look, I enjoy jokes at Javaā€™s expense, but Java is compiled code, and not interpreted. The bytecode hasnā€™t been executed through an interpreter instead of a just-in-time compiler since the 90s.

But since the primary delays in transferring data across a network or the internet is usually the delay in transferring packets, I also wouldnā€™t be surprised if an actually interpreted language could still beat out our non-concurrent code, if it were issuing concurrent requests.

And so slow?

An earlier design made concurrent reads and writes more dangerous, so we turned them off by default. I think weā€™ve worked out that issue now, but we havenā€™t yet switched it back to default on, because there are some really weird esoteric servers out there that have been known to unexpectedly delete peopleā€™s files if you look at the file wrong. So, out of an abundance of caution, and because itā€™s all documented right there in the documentationā€¦ šŸ¤·ā€ā™€ļø

Out-of-band, before firing off a similar hot take to any other project, I would strongly recommend checking everything a lot more thoroughly. You may be working from insufficient information, and/or invalid assumptions, and then your snark wonā€™t come across as all too funny.

from sftp.

drimmeer avatar drimmeer commented on May 24, 2024

Thank you Cassondra for the explanation and advice.

First, I apologize for the harsh word I made. I didn't mean it.
I was kind of surprised and disappointed when I saw that Go was so much slower than Java in my testing, cause the reason why I tried Go was to hope to replace a sftp tool written in Java and running in z/OS, which was too slow due to the performance of JVM, with a much faster solution.
Now your comment "But since the primary delays in transferring data across a network or the internet is usually the delay in transferring packets" brought me a second thought.

But anyway, I'd like to give you more info about what I've tried.
I hadn't try concurrent read or write before. But after I saw your comment, I tried it, unfortunately, I still didn't see much difference.
The same file transfer still took 36 minutes with Go, while it took 8 minutes with Java.

I am not sure if I made any mistake or misused the sftp package. Could you please help take a look?
Please find attached the code I used.
sftp.go.txt

from sftp.

puellanivis avatar puellanivis commented on May 24, 2024

Hm. I cannot seem to see any reason why your Go code should be unnecessarily slow. šŸ¤” You might try increasing the MaxConcurrentRequestsPerFile as well?

from sftp.

drimmeer avatar drimmeer commented on May 24, 2024

Hi Cassondra,

I tried changing MaxConcurrentRequestsPerFile with 3 values (I assume that the default is 60):
100: it took 34 minutes
200: it took 55 minutes
30: it took 60 minutes.

Seems there is no hope to make it much faster with this config.

Do you have any idea what could be the especial of z/OS that causes this problem?

from sftp.

puellanivis avatar puellanivis commented on May 24, 2024

I hadnā€™t even heard of z/OS until you mentioned it. So, I donā€™t really have any insight to help you here. As the platform is not ā€œout-of-the-boxā€ supported, it could just be poor optimizations? šŸ¤·ā€ā™€ļø

from sftp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    šŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. šŸ“ŠšŸ“ˆšŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ā¤ļø Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.