source: doc/theses/mike_brooks_MMath/plots/string-allocn.py@ bd72f517

Last change on this file since bd72f517 was 2410424, checked in by Michael Brooks <mlbrooks@…>, 4 months ago

Pushing work in progress on data for string plots.

All in-thesis plots source from baselined result data, with no manual massaging. Removing older placeholder graph images and temp data.

Allocation plot, especially the last attribution stacked bar, is showing untrustrworthy data.

  • Property mode set to 100644
File size: 3.5 KB
RevLine 
[2410424]1# Read thesis-append-pbv.csv
2# Output for string-graph-peq-sharing.dat
3
4# Project details
5# Filter operation=peq
6# Split "series" goups of sut; only those in the "pretty" list
7# Assert one row per string-length
8# output:
9# string-len op-duration
10# in chunks, each headed by pertty(sut)
11
12import pandas as pd
13import numpy as np
14import os
15import sys
16
17sys.path.insert(0, os.path.dirname(__file__))
18from common import *
19
20# re: apparent cherrypicking
21# The system's response to the liveness threshold is not smooth.
22# The system only uses the threshold to decide whether it will double the text heap again or not.
23# The system's speed for a given string size in a given amount of memory is not affected by the specific value of the liveness threshold.
24# Goals with this selection are
25# - showing one speed result per <string size, memory usage amount>
26# - cropping diminishing or negative returns for large memory sizes
27# - diminishing is obvious, already shown past chosen sweet spot in this selection
28# - negative caused by overflowing llc, not relevant to sting impl
29favSizes = {20:[-1.0, 0.05, 0.1, 0.2, 0.5, 0.9],
30 50:[-1.0, 0.05, 0.1, 0.2, 0.5, 0.9],
31 100:[-1.0, 0.1, 0.2, 0.5, 0.9],
32 200:[-1.0, 0.1, 0.2, 0.5, 0.9],
33 500:[-1.0, 0.4, 0.9, 0.98]}
34
35defaultExpansions = [-1, 0.2]
36
37cfatimings = loadParseTimingData('result-allocate-speed-cfa.csv',
38 xClasNames=['expansion'], xClasDtypes={'expansion':'Float64'},
39 xFactNames=['topIters'], xFactDtypes={'topIters':np.int64})
40
41cfasizings = loadParseSizingData('result-allocate-space-cfa.ssv', xClasNames=['expansion'], xClasDtypes={'expansion':'Float64'})
42
43stltimings = loadParseTimingData('result-allocate-speed-stl.csv',
44 xClasNames=['expansion'], xClasDtypes={'expansion':'Float64'},
45 xFactNames=['topIters'], xFactDtypes={'topIters':np.int64})
46
47stlsizings = loadParseSizingData('result-allocate-space-stl.ssv', xClasNames=['expansion'], xClasDtypes={'expansion':'Float64'})
48
49timings = pd.concat([cfatimings, stltimings])
50sizings = pd.concat([cfasizings, stlsizings])
51
52combined = pd.merge(
53 left=timings,
54 right=sizings[['sut', 'corpus','expansion','hw_cur_req_mem(B)']],
55 on=['sut', 'corpus','expansion']
56)
57
58combined['is-default'] = np.isin(combined['expansion'], defaultExpansions).astype(int)
59
60# print ('!!')
61# print(combined)
62
63
64# Emit
65
66# First, for the CFA curves
67sut = "cfa"
68sutGroup = combined.groupby('sut-platform').get_group(sut)
69
70groupedSize = sutGroup.groupby('corpus-meanlen')
71
72for sz, szgroup in groupedSize:
73
74 if sz in favSizes.keys():
75 szgroup_sorted = szgroup.sort_values(by='expansion')
76
77 print('"{sut}, len={len}"'.format(sut=sut, len=sz))
78 # print(szgroup_sorted) ##
79 # print(szgroup_sorted['expansion'], 'isin', favSizes[sz]) ##
80 favoured = szgroup_sorted.loc[szgroup_sorted['expansion'].isin(favSizes[sz])]
81 # print('!') ##
82 # print(favoured) ##
83 text = favoured[['expansion', 'op-duration-ns', 'hw_cur_req_mem(B)', 'is-default']].to_csv(header=False, index=False, sep='\t')
84 print(text)
85 print()
86
87# Again, for the STL-comparisons, default expansion only
88
89atDefaults = combined.groupby('is-default').get_group(1)
90
91for sz, szgroup in atDefaults.groupby('corpus-meanlen'):
92
93 if sz in favSizes.keys():
94 print(sz)
95 text = szgroup[['expansion', 'op-duration-ns', 'hw_cur_req_mem(B)', 'sut-platform']].to_csv(header=False, index=False, sep='\t')
96 print(text)
97 print()
Note: See TracBrowser for help on using the repository browser.