File tree 9 files changed +674
-23
lines changed
.github/actions/build_analytics
9 files changed +674
-23
lines changed Original file line number Diff line number Diff line change 35
35
export TARGET_DIR=${{ inputs.build_target }}
36
36
export build_preset="${{ inputs.build_preset }}"
37
37
export build_target="${{ inputs.build_target }}"
38
- ./ya tool bloat --linker-map $TARGET_DIR/$TARGET_NAME.map.lld --input $TARGET_DIR/$TARGET_NAME --save-html ya_bloat_html
38
+ ./ya tool bloat --linker-map $TARGET_DIR/$TARGET_NAME.map.lld --input $TARGET_DIR/$TARGET_NAME --save-html ya_bloat_html --save-json bloat.json
39
+ ./ydb/ci/build_bloat/template_bloat.py -j bloat.json -o template_bloat -t template_bloat_html
39
40
./ydb/ci/build_bloat/main.py --build-dir . --html-dir-cpp html_cpp_impact --html-dir-headers html_headers_impact
40
41
./ydb/ci/build_bloat/ydb_upload.py --html-dir-cpp html_cpp_impact --html-dir-headers html_headers_impact
41
42
45
46
set -ex
46
47
s3cmd sync -r --acl-public --stats --no-progress --no-mime-magic --guess-mime-type --no-check-md5 "ya_bloat_html/" "$S3_BUCKET_PATH/ya_bloat_html/"
47
48
echo "[ya bloat tool]($S3_URL_PREFIX/ya_bloat_html/index.html) (better use Safari, because it is too large for Chrome)" >> $GITHUB_STEP_SUMMARY
48
-
49
+
50
+ s3cmd sync -r --acl-public --stats --no-progress --no-mime-magic --guess-mime-type --no-check-md5 "template_bloat.by_size.txt" "$S3_BUCKET_PATH/template_bloat.by_size.txt"
51
+ TEMPLATE_BLOAT_BY_SIZE_URL=$S3_URL_PREFIX/template_bloat.by_size.txt
52
+
53
+ s3cmd sync -r --acl-public --stats --no-progress --no-mime-magic --guess-mime-type --no-check-md5 "template_bloat.by_count.txt" "$S3_BUCKET_PATH/template_bloat.by_count.txt"
54
+ TEMPLATE_BLOAT_BY_COUNT_URL=$S3_URL_PREFIX/template_bloat.by_count.txt
55
+
56
+ s3cmd sync -r --acl-public --stats --no-progress --no-mime-magic --guess-mime-type --no-check-md5 "template_bloat_html/" "$S3_BUCKET_PATH/template_bloat_html/"
57
+ TEMPLATE_BLOAT_TREEMAP_URL=$S3_URL_PREFIX/template_bloat_html/index.html
58
+
59
+ echo "[template bloat]($TEMPLATE_BLOAT_TREEMAP_URL) ([sorted by size]($TEMPLATE_BLOAT_BY_SIZE_URL), [sorted by count]($TEMPLATE_BLOAT_BY_COUNT_URL))" >> $GITHUB_STEP_SUMMARY
60
+
49
61
s3cmd sync -r --acl-public --stats --no-progress --no-mime-magic --guess-mime-type --no-check-md5 "html_cpp_impact/" "$S3_BUCKET_PATH/html_cpp_impact/"
50
62
echo "[cpp compilation time]($S3_URL_PREFIX/html_cpp_impact/index.html)" >> $GITHUB_STEP_SUMMARY
51
63
Original file line number Diff line number Diff line change 68
68
var dom = document . createElement ( 'div' ) ;
69
69
dom . style . zIndex = 1 ;
70
70
dom . className = 'webtreemap-node webtreemap-level' + Math . min ( level , 4 ) ;
71
- if ( tree . data [ '$symbol' ] ) {
72
- dom . className += ' webtreemap-type-' + tree . data [ '$symbol' ] ;
71
+ if ( tree . type ) {
72
+ dom . className += ' webtreemap-type-' + tree . type ;
73
73
}
74
74
if ( tree . children ) {
75
75
dom . className += ' webtreemap-aggregate' ;
131
131
// bad. Result is [start,end) covering the best run for this span.
132
132
// http://scholar.google.com/scholar?cluster=5972512107845615474
133
133
var node = nodes [ start ] ;
134
- var rmin = node . data [ '$area' ] ; // Smallest seen child so far.
134
+ var rmin = node . size ; // Smallest seen child so far.
135
135
var rmax = rmin ; // Largest child.
136
136
var rsum = 0 ; // Sum of children in this span.
137
137
var last_score = 0 ; // Best score yet found.
138
138
for ( var end = start ; node = nodes [ end ] ; ++ end ) {
139
- var size = node . data [ '$area' ] ;
139
+ var size = node . size ;
140
140
if ( size < rmin )
141
141
rmin = size ;
142
142
if ( size > rmax )
162
162
if ( ! ( 'children' in tree ) )
163
163
return ;
164
164
165
- var total = tree . data [ '$area' ] ;
165
+ var total = tree . size ;
166
166
167
167
// XXX why do I need an extra -1/-2 here for width/height to look right?
168
168
var x1 = 0 , y1 = 0 , x2 = width - 1 , y2 = height - 2 ;
208
208
} else {
209
209
child . dom . style . zIndex = 1 ;
210
210
}
211
- var size = child . data [ '$area' ] ;
211
+ var size = child . size ;
212
212
var frac = size / rsum ;
213
213
if ( ysplit ) {
214
214
width = rsum / space ;
Original file line number Diff line number Diff line change
1
+ /* Based on https://github.com/martine/webtreemap */
2
+
3
+ body {
4
+ font-family : sans-serif;
5
+ font-size : 0.8em ;
6
+ height : calc (100vh - 20px );
7
+ }
8
+
9
+ .content {
10
+ height : 100% ;
11
+ display : flex;
12
+ flex-direction : column;
13
+ gap : 1ex ;
14
+ }
15
+
16
+ .header {
17
+ width : 100% ;
18
+ display : flex;
19
+ flex-direction : row;
20
+ flex-wrap : wrap;
21
+ vertical-align : middle;
22
+ }
23
+
24
+ .header div {
25
+ padding : 1ex 1em ;
26
+ }
27
+
28
+ .header legend {
29
+ display : flex;
30
+ flex-direction : row;
31
+ gap : 1em ;
32
+ padding : 0 ;
33
+ }
34
+
35
+ .header .note {
36
+ width : 100% ;
37
+ flex-basis : content;
38
+ flex-grow : 1 ;
39
+ }
40
+
41
+ .header .webtreemap-node {
42
+ flex-basis : max-content;
43
+ flex-grow : 0 ;
44
+ position : relative;
45
+ text-align : center;
46
+ }
47
+
48
+ # map {
49
+ flex-basis : 100% ;
50
+
51
+ min-width : 300px ;
52
+ min-height : 300px ;
53
+
54
+ position : relative;
55
+ cursor : pointer;
56
+ user-select : none;
57
+ }
Original file line number Diff line number Diff line change
1
+ <!DOCTYPE html>
2
+ <!-- Based on https://github.com/martine/webtreemap -->
3
+ < head >
4
+ < title > Build bloat</ title >
5
+ < link rel ="stylesheet " href ="webtreemap.css ">
6
+ < link rel ="stylesheet " href ="bloat.css ">
7
+ </ head >
8
+
9
+ < body >
10
+ < div class ="content ">
11
+ < div class ="header ">
12
+ < div class ="note "> Click on a box to zoom in. Click on the outermost box to zoom out.</ div >
13
+ < legend >
14
+ < div > Legend:</ div >
15
+ < div class ="webtreemap-node webtreemap-type-namespace "> Namespace</ div >
16
+ < div class ="webtreemap-node webtreemap-type-function "> Function</ div >
17
+ </ legend >
18
+ </ div >
19
+ < div id ='map '> </ div >
20
+ </ div >
21
+
22
+ < script src ="bloat.json "> </ script >
23
+ < script type ="text/javascript " src ='webtreemap.js '> </ script >
24
+ < script type ="text/javascript ">
25
+ var map = document . getElementById ( 'map' ) ;
26
+ var bloat = null ;
27
+
28
+ renderTreemap ( map , kTree ) ;
29
+ window . addEventListener ( "resize" , ( event ) => {
30
+ renderTreemap ( map , kTree ) ;
31
+ } ) ;
32
+ </ script >
33
+ </ body >
Original file line number Diff line number Diff line change
1
+ .webtreemap-node {
2
+ /* Required attributes. */
3
+ position : absolute;
4
+ overflow : hidden; /* To hide overlong captions. */
5
+ background : white; /* Nodes must be opaque for zIndex layering. */
6
+ border : solid 1px # 555 ; /* Calculations assume 1px border. */
7
+
8
+ /* Optional: CSS animation. */
9
+ transition : top 0.3s ,
10
+ left 0.3s ,
11
+ width 0.3s ,
12
+ height 0.3s ;
13
+ }
14
+
15
+ /* Optional: highlight nodes on mouseover. */
16
+ .webtreemap-node : hover {
17
+ background : # FFFFFF ;
18
+ }
19
+
20
+ /* Optional: Different background colors depending on type. */
21
+ .webtreemap-type-namespace {
22
+ background : # 66C2A5 ;
23
+ }
24
+ .webtreemap-type-function {
25
+ background : # FC8D62 ;
26
+ }
27
+ .webtreemap-type-dir {
28
+ background : # 8DA0CB ;
29
+ }
30
+
31
+ # legend > * {
32
+ border : solid 1px # 444 ;
33
+ }
34
+
35
+ /* Optional: Different borders depending on level. */
36
+ /*
37
+ .webtreemap-level0 {
38
+ border: solid 1px #444;
39
+ }
40
+ .webtreemap-level1 {
41
+ border: solid 1px #666;
42
+ }
43
+ .webtreemap-level2 {
44
+ border: solid 1px #888;
45
+ }
46
+ .webtreemap-level3 {
47
+ border: solid 1px #aaa;
48
+ }
49
+ .webtreemap-level4 {
50
+ border: solid 1px #ccc;
51
+ }
52
+ */
53
+
54
+ /* Optional: styling on node captions. */
55
+ .webtreemap-caption {
56
+ font-family : sans-serif;
57
+ font-size : 11px ;
58
+ padding : 2px ;
59
+ text-align : center;
60
+ }
61
+
62
+ /* Optional: styling on captions on mouse hover. */
63
+ /*.webtreemap-node:hover > .webtreemap-caption {
64
+ text-decoration: underline;
65
+ }*/
You can’t perform that action at this time.
0 commit comments