commit 405c1ab6e364126f173cfb21f44ddaf56790a079 Author: Christopher Haster Date: Sun Mar 31 20:42:17 2019 -0500 Created gh-images branch for storing images diff --git a/file-cost.py b/file-cost.py new file mode 100755 index 0000000..baa0ff6 --- /dev/null +++ b/file-cost.py @@ -0,0 +1,55 @@ +#!/usr/bin/env python + +import matplotlib +matplotlib.use('SVG') +import matplotlib.pyplot as plt +import numpy as np + +matplotlib.rc('font', family='sans-serif', size=11) +matplotlib.rc('axes', titlesize='medium', labelsize='medium') +matplotlib.rc('xtick', labelsize='small') +matplotlib.rc('ytick', labelsize='small') + +fig, ax = plt.subplots(figsize=(6, 3.5)) +ax.set_title('File storage cost') + +# multiplicative cost of inline files +def inline_cost(n, B): + #return 4+n-n + return np.full_like(n, 4) + +# multiplicative cost of ctz skip-list files +def ctz_cost(n, B): + return (np.ceil(n/B)*B) / n + +# combined multiplicative cost +def file_cost(n, B): + return np.where(n < B/4, inline_cost(n, B), ctz_cost(n, B)) + +t = np.arange(0.0, 80.0, 0.25) +ax.plot(t, file_cost(t, 16)) +t1 = np.arange(0.0, 16.0/4.0 + 0.5, 0.25) +t2 = np.arange(16.0/4.0, 80.0, 0.25) +ax.plot(t1, ctz_cost(t1, 16), color='C0', linestyle=(2.65, (3.65,1.65))) +ax.plot(t2, inline_cost(t2, 16), color='C0', linestyle=(3.65, (3.65,1.65))) + +ax.text(70.5, 4.15, 'inline file', size='small') +ax.text(3.3, 5.85, 'ctz skip-list', rotation=-85, size='small') + +ax.set_xlabel('file size') +ax.set_xlim(0, 80) +ax.set_ylabel('multiplicative cost') +ax.set_ylim(0, 6) + +xticks = np.arange(0, 80+1, 16) +ax.set_xticks(xticks) +ax.set_xticklabels(['%dKiB' % ((t*(4096/16))/1024) for t in xticks]) +yticks = np.arange(0, 6+1, 2) +ax.set_yticks(yticks) +ax.set_yticklabels(['%dx' % t for t in yticks]) + +ax.spines['right'].set_visible(False) +ax.spines['top'].set_visible(False) + +fig.tight_layout() +plt.savefig('file-cost.svg', bbox_inches="tight") diff --git a/file-cost.svg b/file-cost.svg new file mode 100644 index 0000000..5a41f09 --- /dev/null +++ b/file-cost.svg @@ -0,0 +1,995 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/metadata-cost.py b/metadata-cost.py new file mode 100755 index 0000000..1781dce --- /dev/null +++ b/metadata-cost.py @@ -0,0 +1,40 @@ +#!/usr/bin/env python + +import matplotlib +matplotlib.use('SVG') +import matplotlib.pyplot as plt +import numpy as np + +matplotlib.rc('font', family='sans-serif', size=11) +matplotlib.rc('axes', titlesize='medium', labelsize='medium') +matplotlib.rc('xtick', labelsize='small') +matplotlib.rc('ytick', labelsize='small') + +fig, ax = plt.subplots(figsize=(6, 3.5)) +ax.set_title('Metadata pair update cost') + +# multiplicative cost of metadata +def cost(r, n, size): + cost = n + n*(r*(size/n) / ((1-r)*(size/n) + 1)) + return cost / n + +t = np.arange(0.0, 1.0, 0.01) +ax.plot(t, cost(t, 100, 4096)) + +ax.set_xlabel('% full') +ax.set_xlim(0, 1) +ax.set_ylabel('multiplicative cost') +ax.set_ylim(0, 12) + +xticks = np.arange(0.0, 1+0.1, 0.2) +ax.set_xticks(xticks) +ax.set_xticklabels(['%d%%' % (100*t) for t in xticks]) +yticks = np.arange(0, 12+1, 2) +ax.set_yticks(yticks) +ax.set_yticklabels(['%dx' % t for t in yticks]) + +ax.spines['right'].set_visible(False) +ax.spines['top'].set_visible(False) + +fig.tight_layout() +plt.savefig('metadata-cost.svg', bbox_inches="tight") diff --git a/metadata-cost.svg b/metadata-cost.svg new file mode 100644 index 0000000..8f4272c --- /dev/null +++ b/metadata-cost.svg @@ -0,0 +1,968 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/wear-distribution.py b/wear-distribution.py new file mode 100755 index 0000000..df9601a --- /dev/null +++ b/wear-distribution.py @@ -0,0 +1,52 @@ +#!/usr/bin/env python + +import matplotlib +matplotlib.use('SVG') +import matplotlib.pyplot as plt +import matplotlib.gridspec as gridspec +import numpy as np + +matplotlib.rc('font', family='sans-serif', size=11) +matplotlib.rc('axes', titlesize='medium', labelsize='medium') +matplotlib.rc('xtick', labelsize='small') +matplotlib.rc('ytick', labelsize='small') + +np.random.seed(map(ord, "hello")) + +gs = gridspec.GridSpec(nrows=2, ncols=2, height_ratios=[1, 2], + wspace=0.25, hspace=0.25) + +fig = plt.figure(figsize=(7, 5.5)) +ax1 = fig.add_subplot(gs[0, 0]) +ax2 = fig.add_subplot(gs[0, 1], sharex=ax1, sharey=ax1) +ax3 = fig.add_subplot(gs[1, :]) + +# Convolution (I think?) of two types of uniform distributions under modulo +w1 = np.random.randint(0, 100, 30) +w2 = np.arange(0, 30, 1) +w3 = np.array([w2 + i for i in w1]).flatten() % 100 + +ax1.hist(w1, bins=100, range=(0,100), histtype='stepfilled') +ax2.hist(w2, bins=100, range=(0,100), histtype='stepfilled') +ax3.hist(w3, bins=100, range=(0,100), histtype='stepfilled') + +ax1.set_title('Random offset') +ax2.set_title('Linear allocation') +ax3.set_title('Cumulative allocation') + +ax1.set_ylabel('wear') +ax1.set_yticks(np.arange(0, 3)) +ax3.set_ylabel('wear') +ax3.set_xlabel('block address') + +for ax in [ax1,ax2,ax3]: + ax.set_xlim(0, 100) + ax.set_xticklabels([]) + ax.set_yticklabels([]) + ax.spines['right'].set_visible(False) + ax.spines['top'].set_visible(False) + +ax1.text(109.25, 1, '$\\ast$') + +fig.tight_layout() +plt.savefig('wear-distribution.svg', bbox_inches="tight") diff --git a/wear-distribution.svg b/wear-distribution.svg new file mode 100644 index 0000000..94bf019 --- /dev/null +++ b/wear-distribution.svg @@ -0,0 +1,2100 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +