tensorflow / profiler
Unit Size

The distribution of size of units (measured in lines of code).

Intro
  • Unit size measurements show the distribution of size of units of code (methods, functions...).
  • Units are classified in four categories based on their size (lines of code): 1-20 (small units), 20-50 (medium size units), 51-100 (long units), 101+ (very long units).
  • You should aim at keeping units small (< 20 lines). Long units may become "bloaters", code that have increased to such gargantuan proportions that they are hard to work with.
Learn more...
Unit Size Overall
  • There are 419 units with 5,930 lines of code in units (33.1% of code).
    • 2 very long units (253 lines of code)
    • 15 long units (974 lines of code)
    • 63 medium size units (2,096 lines of code)
    • 91 small units (1,366 lines of code)
    • 248 very small units (1,241 lines of code)
4% | 16% | 35% | 23% | 20%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py12% | 14% | 39% | 14% | 20%
ts2% | 17% | 34% | 25% | 20%
js0% | 0% | 0% | 43% | 56%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
plugin/tensorboard_plugin_profile/convert19% | 7% | 50% | 4% | 18%
frontend/app/components2% | 19% | 35% | 25% | 17%
plugin/tensorboard_plugin_profile0% | 28% | 15% | 32% | 23%
frontend/app/common0% | 0% | 29% | 14% | 56%
frontend/app/services0% | 0% | 19% | 38% | 42%
ROOT0% | 0% | 73% | 0% | 26%
plugin/trace_viewer/tf_trace_viewer0% | 0% | 0% | 47% | 52%
frontend/app0% | 0% | 0% | 37% | 62%
frontend/app/store0% | 0% | 0% | 0% | 100%
plugin/tensorboard_plugin_profile/static0% | 0% | 0% | 0% | 100%
plugin0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def get_step_breakdown_table_args()
in plugin/tensorboard_plugin_profile/convert/input_pipeline_proto_to_gviz.py
151 3 1
drawChart()
in frontend/app/components/memory_profile/memory_timeline_graph/memory_timeline_graph.ts
102 17 0
private findPeakMemoryUsage()
in frontend/app/components/memory_viewer/memory_usage/memory_usage.ts
99 19 2
override process()
in frontend/app/components/tensorflow_stats/operations_table/operations_table_data_provider.ts
82 10 0
drawTable()
in frontend/app/components/overview/top_ops_table/top_ops_table.ts
79 18 0
function mergeSortTables()
in frontend/app/components/chart/table_utils.ts
79 19 7
setIdleOption()
in frontend/app/components/tensorflow_stats/tensorflow_stats.ts
68 30 1
def capture_route_impl()
in plugin/tensorboard_plugin_profile/profile_plugin.py
68 12 2
override parseData()
in frontend/app/components/input_pipeline/host_side_analysis_detail/host_side_analysis_detail_table_data_provider.ts
61 11 1
def xspace_to_tool_data()
in plugin/tensorboard_plugin_profile/convert/raw_to_tool_data.py
59 19 4
enumerateColumns()
in frontend/app/components/kernel_stats/kernel_stats_table/kernel_stats_table.ts
56 18 0
override parseTips()
in frontend/app/components/overview/recommendation_result_view/recommendation_result_view.ts
55 14 0
initChart()
in frontend/app/components/chart/chart.ts
55 13 0
private getDataTable()
in frontend/app/components/kernel_stats/kernel_stats_chart/kernel_stats_chart.ts
54 6 0
def data_impl()
in plugin/tensorboard_plugin_profile/profile_plugin.py
54 15 2
createDataTable()
in frontend/app/components/memory_profile/memory_breakdown_table/memory_breakdown_table.ts
53 12 0
showTooltip()
in frontend/app/components/pod_viewer/topology_graph/topology_graph.ts
52 15 1
memoryProfileSummary()
in frontend/app/components/memory_profile/memory_profile_summary/memory_profile_summary.ts
48 21 0
drawChart()
in frontend/app/components/memory_viewer/max_heap_chart/max_heap_chart.ts
48 10 0
drawActiveChart()
in frontend/app/components/memory_viewer/program_order_chart/program_order_chart.ts
48 4 0