question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

.upload with FileDataPart is slow?

See original GitHub issue

This is for version 2.0.1 Don’t know why, but this code (serviceUrl is localhost in my case):

val response = Fuel.upload(serviceUrl/"jars"/"upload")
    .add(FileDataPart(file = fileToUpload, name = "jarfile", contentType = "application/java-archive"))
    .awaitObject(uploadJarDeserializer)

is very slow on large files (over 100 MB). When I switch to

val response = Fuel.upload(serviceUrl/"jars"/"upload")
    .add(BlobDataPart(inputStream = fileToUpload.inputStream(), name = "jarfile", filename = fileToUpload.name, contentType = "application/java-archive"))
    .awaitObject(uploadJarDeserializer)

it is very fast, as expected.

So by replacing FileDataPart to BlobDataPart - I have improved a performance in order of magnitude. Am I doing something wrong with FileDataPart?

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:9

github_iconTop GitHub Comments

3reactions
SleeplessBytecommented, Apr 3, 2019

Ugh. @mobiletoly, yes you are right. setFixedLengthStreamingMode is supposed to be faster than setChunkedStreamingMode. However, this is enough information for us to do some debugging here.

Thank you for the time ❤️

1reaction
mobiletolycommented, Mar 29, 2019

this is desktop app (TornadoFX-based app), running on my Mac, so no Android. Using BlobDataPart is very fast, using Apache HttpClient is very fast, it is only when I use FileDataPart I start having issues.

Read more comments on GitHub >

github_iconTop Results From Across the Web

File upload is taking really long - QuickReviewer
File upload is taking really long. If you're facing the frustration of slow upload speeds there are a few things you need to...
Read more >
Java file uploading painfully slow - android - Stack Overflow
It sounds as if the app which is sending the data from the Android end isn't closing the connection when it finishes sending...
Read more >
Why are my Online Resources files uploading slowly?
If your upload is slower than expected, it could be due to multiple factors, including: Lower overall upload speeds provided by your particular...
Read more >
How to optimize upload speed? - Hightail - Zendesk
Troubleshooting Steps if you notice a slow upload speed: If your upload speeds are slower than you think they should be there may...
Read more >
PDF - File is Too Large to Upload or Upload is Very Slow
To determine the size of a document when you have it open in Adobe Acrobat, click on File > Document Properties or press...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found