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

[WIP] Speed up Hashing for ARMv8 #738

Merged
merged 1 commit into from Jan 5, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions make-all.bash
Expand Up @@ -8,3 +8,5 @@
./make-go.bash 386
./make-syncthing.bash 386

./make-go.bash arm64
./make-syncthing.bash arm64
11 changes: 6 additions & 5 deletions make-go.bash
Expand Up @@ -27,17 +27,18 @@ case "$1" in
export GOARCH=arm
export GOARM=5
;;
arm64)
export GOOS=linux
export GOARCH=arm64
export GOARM=8
;;
386)
export GOOS=linux
export GOARCH=386
export GO386=387
;;
amd64)
export GOOS=linux
export GOARCH=amd64
;;
*)
echo "Must specify either arm or 386 or amd64"
echo "Invalid architecture"
exit 1
esac

Expand Down
15 changes: 8 additions & 7 deletions make-syncthing.bash
Expand Up @@ -13,21 +13,22 @@ case "$1" in
export GOARM=5
export TARGETDIR=$MYDIR$JNIDIR/armeabi
;;
arm64)
export CGO_ENABLED=0
export GOOS=linux
export GOARCH=arm64
export GOARM=8
export TARGETDIR=$MYDIR$JNIDIR/arm64-v8a
;;
386)
export CGO_ENABLED=0
export GOOS=linux
export GOARCH=386
export GO386=387
export TARGETDIR=$MYDIR$JNIDIR/x86
;;
amd64)
export CGO_ENABLED=0
export GOOS=linux
export GOARCH=amd64
export TARGETDIR=$MYDIR$JNIDIR/x86_64
;;
*)
echo "Must specify either arm or 386 or amd64"
echo "Invalid architecture"
exit 1
esac

Expand Down
Expand Up @@ -37,10 +37,7 @@ public class SyncthingRunnable implements Runnable {
private static final String TAG_NICE = "SyncthingRunnableIoNice";
private static final String TAG_KILL = "SyncthingRunnableKill";
public static final String UNIT_TEST_PATH = "was running";
/**
* Path to the native, integrated syncthing binary, relative to the data folder
*/
public static final String BINARY_NAME = "lib/libsyncthing.so";
public static final String BINARY_NAME = "libsyncthing.so";
private static final int LOG_FILE_MAX_LINES = 1000;

private static final AtomicReference<Process> mSyncthing = new AtomicReference<>();
Expand All @@ -63,7 +60,7 @@ public enum Command {
*/
public SyncthingRunnable(Context context, Command command) {
mContext = context;
mSyncthingBinary = mContext.getApplicationInfo().dataDir + "/" + BINARY_NAME;
mSyncthingBinary = mContext.getApplicationInfo().nativeLibraryDir + "/" + BINARY_NAME;
mLogFile = new File(mContext.getExternalFilesDir(null), "syncthing.log");
switch (command) {
case generate:
Expand All @@ -87,7 +84,7 @@ public SyncthingRunnable(Context context, Command command) {
*/
public SyncthingRunnable(Context context, String[] manualCommand) {
mContext = context;
mSyncthingBinary = mContext.getApplicationInfo().dataDir + "/" + BINARY_NAME;
mSyncthingBinary = mContext.getApplicationInfo().nativeLibraryDir + "/" + BINARY_NAME;
mCommand = manualCommand;
mLogFile = new File(mContext.getExternalFilesDir(null), "syncthing.log");
}
Expand Down