Skip to content

Instantly share code, notes, and snippets.

@agran
Created November 20, 2015 03:42
Show Gist options
  • Save agran/1d0165d8358296a73d31 to your computer and use it in GitHub Desktop.
Save agran/1d0165d8358296a73d31 to your computer and use it in GitHub Desktop.
@Test
public void testBase_58_speed() {
Stopwatch stopwatchAll = new Stopwatch();
for (int i = 0; i < 10000000; i++) {
String randStr = Long.toString((long)(Math.random()*1000000000));
Base58.decode(Base58.encode(randStr.getBytes()));
}
System.out.println("Google Base58 (old): "+stopwatchAll.elapsedTime());
stopwatchAll = new Stopwatch();
for (int i = 0; i < 10000000; i++) {
String randStr = Long.toString((long)Math.random()*1000000000);
Base58.decode(Base58.encode(randStr.getBytes()));
}
System.out.println("Ronald W Hoffman Base58 (new): "+stopwatchAll.elapsedTime());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment