Skip to content

Instantly share code, notes, and snippets.

View toruw's full-sized avatar

Toru Watanabe toruw

View GitHub Profile
@toruw
toruw / ioperf_test.py
Last active August 29, 2015 14:17
IO Performance comparison
import mmap,time
def test_io():
f = open('test.dat','r+b',0)
start = time.time()
i = 0
while i < 1000000:
f.read()
i += 1
end = time.time()
print("test_io: %s ms" % ((end - start)*1000))
@toruw
toruw / IOPerfTest.java
Created March 29, 2015 14:21
IO performance comparison in java
import java.io.RandomAccessFile;
import java.nio.ByteBuffer;
import java.nio.channels.FileChannel.MapMode;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
public class IOPerfTest {