This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import threading | |
NUM_THREADS = 8 | |
FILE_SIZE = 4 * 1024 * 1024 * 1024 | |
BLOCK_SIZE = 1024 * 1024 | |
BLOCK = b'\0' * BLOCK_SIZE | |
def worker(fd, offset, length): | |
for i in range(offset, offset + length, BLOCK_SIZE): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ec2-user@ip-172-31-0-156 ~]$ ~/go/src/github.com/kahing/goofys/bench/bench.sh "$HOME/s3fs-fuse/src/s3fs gaultest-us-west-1b $HOME/mnt -o use_path_request_style -o url=https://s3-us-west-1.amazonaws.com -o endpoint=us-west-1 -ostat_cache_expire=1" ~/mnt | |
create_files 7.834 | |
rm_files 2.093 | |
create_files 10.415 | |
rm_files 2.119 | |
create_files 10.136 | |
rm_files 2.192 | |
create_files 9.773 | |
rm_files 1.932 | |
create_files 9.103 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/env/python3 | |
class CircularBuffer: | |
def __init__(self, capacity): | |
self.array = [None] * capacity | |
self.used = 0 | |
self.index = 0 | |
def push(self, elem): | |
if self.used == len(self.array): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Keybase proof | |
I hereby claim: | |
* I am gaul on github. | |
* I am gaul (https://keybase.io/gaul) on keybase. | |
* I have a public key ASCAEBCgIFZcqRtP-nQ-4e5w06M4DyIenIzaXdSizH56TAo | |
To claim this, I am signing this object: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ mvn clean test-compile -e | |
[INFO] Error stacktraces are turned on. | |
[INFO] Scanning for projects... | |
[INFO] ------------------------------------------------------------------------ | |
[INFO] Reactor Build Order: | |
[INFO] | |
[INFO] Apache jclouds Project | |
[INFO] jclouds shared Maven resources | |
[INFO] jclouds Components Core | |
[INFO] jclouds SLF4J Logging Module |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Demonstrate overhead of primitives stored in an object. Note that each | |
* object has 12 bytes of overhead for the class pointer, flags, and monitor and | |
* the JVM pads each object to the next 8 byte alignment. Thus an object with | |
* two byte fields will consume 16 bytes and an object with two int fields will | |
* consume 24 bytes: | |
* | |
* $ javac PrimitiveOverhead.java ; java PrimitiveOverhead | |
* | |
* num #instances #bytes class name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* naughty - run a program with soft real-time priority. naughty may reduce | |
* clock skew when benchmarking not quite idle systems. Tested on Linux | |
* 2.4.22. This program has been placed in the public domain. Written by | |
* Andrew Gaul <andrew@gaul.org>. Last modified 2 March 2004. | |
*/ | |
/* XXX watchdog to kill runaway process */ | |
#include <sched.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Demonstrate mapping and filtering using Java 7, Guava, and Java 8 constructs. | |
* | |
* Test with: | |
* javac -cp .:$HOME/.m2/repository/com/google/guava/guava/15.0/guava-15.0.jar MapFilterTest.java | |
*/ | |
import java.util.Collection; | |
import java.util.Iterator; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class PageSetIterableTest { | |
private class PageSetIterable implements Iterator<StorageMetadata> { | |
private final String container; | |
private ListContainerOptions options; | |
private PageSet<? extends StorageMetadata> set; | |
private Iterator<? extends StorageMetadata> iterator; | |
private PageSetIterable(String container, ListContainerOptions options) { | |
this.container = checkNotNull(container); | |
advanceList(options); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.Closeable; | |
import java.io.IOException; | |
import com.google.common.io.Closer; | |
public class CloserTest { | |
private static void testCloserJava6() throws Exception { | |
Closer closer = Closer.create(); | |
try { | |
Closeable closeable = closer.register( |
NewerOlder