diff --git a/.gitignore b/.gitignore index fea00e8..fbf7f09 100644 --- a/.gitignore +++ b/.gitignore @@ -15,3 +15,4 @@ /packages /results /data/dictionary +/benchmark/flavors-analisys/.vs/flavors-analisys/v15 diff --git a/benchmark/benchmark-scripts/findBenchmarks.py b/benchmark/flavors-analisys/findBenchmarks.py similarity index 92% rename from benchmark/benchmark-scripts/findBenchmarks.py rename to benchmark/flavors-analisys/findBenchmarks.py index 5b5705c..43bb1d6 100644 --- a/benchmark/benchmark-scripts/findBenchmarks.py +++ b/benchmark/flavors-analisys/findBenchmarks.py @@ -19,14 +19,6 @@ def runKeysFind(caption, benchPath, configPath, resultsPath): os.remove(config['resultFilePath']) return data - -def calculateThroughputs(data): - data['BuildThroughput'] = data['Count'] / (data['Sort'] + data['Reshape'] + data['Build']) * 10**9 - data['FindThroughput'] = data['Count'] / data['Find'] * 10**9 - data['FindRandomThroughput'] = data['Count'] / data['FindRandom'] * 10**9 - data['FindSortedThroughput'] = data['Count'] / data['FindRandomSorted'] * 10**9 - - return data def drawChart(maxData, meanData, minData, column, caption, groupColumn, chartKind): data = pd.DataFrame() diff --git a/benchmark/flavors-analisys/flavors-analisys.pyproj b/benchmark/flavors-analisys/flavors-analisys.pyproj new file mode 100644 index 0000000..ac339c7 --- /dev/null +++ b/benchmark/flavors-analisys/flavors-analisys.pyproj @@ -0,0 +1,37 @@ + + + Debug + 2.0 + 3c2889e9-75e1-44ee-8422-f7978c05abdd + . + flavorsAnalisys.py + + + . + . + flavors-analisys + flavors-analisys + + + true + false + + + true + false + + + + + + + + + + + + + + \ No newline at end of file diff --git a/benchmark/flavors-analisys/flavors-analisys.sln b/benchmark/flavors-analisys/flavors-analisys.sln new file mode 100644 index 0000000..d3c8f53 --- /dev/null +++ b/benchmark/flavors-analisys/flavors-analisys.sln @@ -0,0 +1,23 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.27130.2010 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{888888A0-9F3D-457C-B088-3A5042F75D52}") = "flavors-analisys", "flavors-analisys.pyproj", "{3C2889E9-75E1-44EE-8422-F7978C05ABDD}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {3C2889E9-75E1-44EE-8422-F7978C05ABDD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3C2889E9-75E1-44EE-8422-F7978C05ABDD}.Release|Any CPU.ActiveCfg = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {46B7551D-9F3B-47BB-B804-9E7BE1BCC2B2} + EndGlobalSection +EndGlobal diff --git a/benchmark/flavors-analisys/flavorsAnalisys.py b/benchmark/flavors-analisys/flavorsAnalisys.py new file mode 100644 index 0000000..5044aea --- /dev/null +++ b/benchmark/flavors-analisys/flavorsAnalisys.py @@ -0,0 +1,74 @@ +import pandas as pd +import numpy as np +import matplotlib.pyplot as plt + +def calculateThroughputs(data): + columns = list(data) + + if 'Sort' in columns: + data['BuildThroughput'] = data['Count'] / (data['Sort'] + data['Reshape'] + data['Build']) * 10 ** 9 + else: + data['BuildThroughput'] = data['Count'] / data['Build'] * 10 ** 9 + + data['FindThroughput'] = data['Count'] / data['Find'] * 10 ** 9 + data['FindRandomThroughput'] = data['RandomCount'] / data['FindRandom'] * 10 ** 9 + + if 'FindRandomSorted' in columns: + data['FindSortedThroughput'] = data['RandomCount'] / data['FindRandomSorted'] * 10 ** 9 + + return data + +dataPath = 'D:\\Projekty\\flavors-results\\P100-keys\\keysResults.csv' +#dataPath = 'D:\\Projekty\\flavors-results\\4790K-hostKeys\\hostResults.csv' + +rawData = calculateThroughputs( + pd.read_csv( + dataPath, + sep=';')) + +data = pd.DataFrame( + pd.pivot_table( + pd.DataFrame( + pd.pivot_table( + rawData, + index=['Config', 'Count', 'RandomCount'], + values=['BuildThroughput', 'FindThroughput', 'FindRandomThroughput'], + aggfunc=[np.mean]) + .to_records()) + .rename( + index=str, + columns={"('mean', 'BuildThroughput')": "BuildThroughput", "('mean', 'FindThroughput')": "FindThroughput", "('mean', 'FindRandomThroughput')": "FindRandomThroughput"}), + index=['Count'], + values=['BuildThroughput', 'FindThroughput', 'FindRandomThroughput'], + aggfunc=[np.max]).to_records()).rename(index=str, + columns={"('amax', 'BuildThroughput')": "BuildThroughput", "('amax', 'FindThroughput')": "FindThroughput", "('amax', 'FindRandomThroughput')": "FindRandomThroughput"}) + +print(data) + +data.plot( + x='Count', + y='BuildThroughput', + title='BuildThroughput', + grid='on', + kind='line', + ax=plt.gca()) + +plt.figure() +data.plot( + x='Count', + y='FindThroughput', + title='FindThroughput', + grid='on', + kind='line', + ax=plt.gca()) + +plt.figure() +data.plot( + x='Count', + y='FindRandomThroughput', + title='FindRandomThroughput', + grid='on', + kind='line', + ax=plt.gca()) +plt.show() + diff --git a/benchmark/benchmark-scripts/flavorsBenchmarks.py b/benchmark/flavors-analisys/flavorsBenchmarks.py similarity index 100% rename from benchmark/benchmark-scripts/flavorsBenchmarks.py rename to benchmark/flavors-analisys/flavorsBenchmarks.py