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

Speed Optimizations #23

Open
NateWickstrom opened this issue Jul 23, 2017 · 2 comments
Open

Speed Optimizations #23

NateWickstrom opened this issue Jul 23, 2017 · 2 comments

Comments

@NateWickstrom
Copy link

Two recommendations to make things faster.

  1. Gzip the bins and then unzip during download. The downloadFile function in the IPFSDaemon would look like:
    val zipped = responseBody.source()
    val source = GzipSource(zipped)

    val buffer = Okio.buffer(Okio.sink(getBinaryFile()))

    var total = 0L
    var cnt = 0L

    do {
        cnt = source.read(buffer.buffer(), 1024)
        total += cnt

        val size = cnt / 1024
        progressDialog.setMessage("$size kB")
    } while (cnt > 0)

https://github.com/ligi/IPFSDroid/blob/master/app/src/main/java/org/ligi/ipfsdroid/IPFSDaemon.kt#L74-L88

  1. Compile the bins with target android-21: xgo -go 1.8.3 --targets=android-21/* ./cmd/ipfs, so you get the additional arm64 bin, which is way faster when applicable (most newer devices):
@ligi
Copy link
Owner

ligi commented Aug 9, 2017

Thanks for the suggestions! Sorry I did not see this earlier - especially 2 souds like a great idea!

@ligi ligi added the bounty label Oct 18, 2017
@issueth
Copy link

issueth bot commented Oct 18, 2017

This issue now has a bounty-address via issuETH.

Your bounty-address is d129b8a0bccfffc2c84157beca267d03a71c1995
Watch on rinkeby
Watch on main

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants