-
Notifications
You must be signed in to change notification settings - Fork 216
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
12,074 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
ifeq (debian, $(shell hostname)) | ||
ITEMS=100 | ||
else | ||
ITEMS=3000 | ||
endif | ||
|
||
ARGS=\ | ||
"normal none none sort pread" \ | ||
"normal sort fadvise none pread" \ | ||
"normal sort readahead none pread" | ||
|
||
|
||
B=\ | ||
"normal sort fadvise rand gthread512" \ | ||
"normal sort fadvise sort gthread512" | ||
|
||
|
||
all: read_bench random.bin | ||
@for ARGS in $(ARGS); do \ | ||
sync; \ | ||
sudo bash -c "echo 3 > /proc/sys/vm/drop_caches"; \ | ||
sync; \ | ||
sudo dd if=/dev/sda of=/dev/null bs=1M count=1 2> /dev/null; \ | ||
./read_bench $(ITEMS) $$ARGS; \ | ||
done | ||
|
||
|
||
random.bin: | ||
dd if=/dev/urandom of=random.bin bs=1M count=16 | ||
|
||
|
||
|
||
read_bench: read_bench.c | ||
gcc -g -O2 -Wall read_bench.c -o read_bench -lm -lrt -I/usr/lib64/glib-2.0/include -I/usr/lib/glib-2.0/include -I/usr/include/glib-2.0 -lgthread-2.0 | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
* different options for fadvise - random? dontuse? + | ||
* visualize input data | ||
* random and sorted fadvise | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/usr/bin/env python | ||
import numpy as np | ||
import matplotlib.mlab as mlab | ||
import matplotlib.pyplot as plt | ||
|
||
x = [] | ||
for line in open("norm.csv"): | ||
x.append( float(line) ) | ||
|
||
|
||
# the histogram of the data | ||
n, bins, patches = plt.hist(x, 50, normed=1, facecolor='green', alpha=0.75) | ||
|
||
# add a 'best fit' line | ||
y = mlab.normpdf( bins, 0, 5) | ||
l = plt.plot(bins, y, 'r--', linewidth=1) | ||
|
||
plt.xlabel('Smarts') | ||
plt.ylabel('Probability') | ||
plt.title(r'$\mathrm{Histogram\ of\ IQ:}\ \mu=100,\ \sigma=15$') | ||
plt.axis([-5, 5, 0, 0.8]) | ||
plt.grid(True) | ||
|
||
plt.show() |
Oops, something went wrong.