Skip to content

Commit

Permalink
Added python project for results analisys
Browse files Browse the repository at this point in the history
  • Loading branch information
wazka committed Dec 23, 2017
1 parent 62a09fe commit dfe6ba0
Show file tree
Hide file tree
Showing 6 changed files with 135 additions and 8 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@
/packages
/results
/data/dictionary
/benchmark/flavors-analisys/.vs/flavors-analisys/v15
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
37 changes: 37 additions & 0 deletions benchmark/flavors-analisys/flavors-analisys.pyproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>3c2889e9-75e1-44ee-8422-f7978c05abdd</ProjectGuid>
<ProjectHome>.</ProjectHome>
<StartupFile>flavorsAnalisys.py</StartupFile>
<SearchPath>
</SearchPath>
<WorkingDirectory>.</WorkingDirectory>
<OutputPath>.</OutputPath>
<Name>flavors-analisys</Name>
<RootNamespace>flavors-analisys</RootNamespace>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<DebugSymbols>true</DebugSymbols>
<EnableUnmanagedDebugging>false</EnableUnmanagedDebugging>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<DebugSymbols>true</DebugSymbols>
<EnableUnmanagedDebugging>false</EnableUnmanagedDebugging>
</PropertyGroup>
<ItemGroup>
<Compile Include="findBenchmarks.py" />
<Compile Include="flavorsBenchmarks.py" />
<Compile Include="flavorsAnalisys.py" />
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\Python Tools\Microsoft.PythonTools.targets" />
<!-- Uncomment the CoreCompile target to enable the Build command in
Visual Studio and specify your pre- and post-build commands in
the BeforeBuild and AfterBuild targets below. -->
<!--<Target Name="CoreCompile" />-->
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
</Project>
23 changes: 23 additions & 0 deletions benchmark/flavors-analisys/flavors-analisys.sln
Original file line number Diff line number Diff line change
@@ -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
74 changes: 74 additions & 0 deletions benchmark/flavors-analisys/flavorsAnalisys.py
Original file line number Diff line number Diff line change
@@ -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()

0 comments on commit dfe6ba0

Please sign in to comment.