facebookresearch / DLRM-FlexFlow
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 1,462 units with 17,686 lines of code in units (39.5% of code).
    • 15 very long units (3,158 lines of code)
    • 54 long units (3,505 lines of code)
    • 130 medium size units (3,830 lines of code)
    • 182 small units (2,655 lines of code)
    • 1,081 very small units (4,538 lines of code)
17% | 19% | 21% | 15% | 25%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
cc29% | 22% | 26% | 10% | 11%
py8% | 16% | 17% | 19% | 38%
h21% | 33% | 24% | 7% | 13%
inc0% | 100% | 0% | 0% | 0%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src34% | 23% | 23% | 6% | 11%
python7% | 18% | 20% | 18% | 33%
flexflow9% | 16% | 16% | 19% | 38%
scripts17% | 20% | 30% | 19% | 11%
nmt39% | 15% | 30% | 12% | 1%
config0% | 100% | 0% | 0% | 0%
bootcamp_demo0% | 0% | 94% | 0% | 5%
include0% | 0% | 0% | 29% | 70%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
644 1 0
293 46 10
def apply()
in python/flexflow/torch/model.py
268 49 3
def apply()
in flexflow/torch/model.py
268 49 3
cc
float Simulator::simulate_runtime()
in src/runtime/simulator.cc
265 56 4
cc
void FFModel::compile()
in src/runtime/model.cc
224 52 3
def torch_to_flexflow_str()
in python/flexflow/torch/fx.py
156 49 1
def torch_to_flexflow_str()
in flexflow/torch/fx.py
156 49 1
cc
void FFMapper::map_task()
in src/mapper/mapper.cc
148 32 4
cc
int main()
in nmt/nmt.cc
137 1 2
cc
float simulate_time()
in scripts/simulator.cc
126 30 2
120 8 5
120 24 6
cc
void FFConfig::parse_args()
in src/runtime/model.cc
118 38 2
115 19 6
def update()
in python/flexflow/keras/utils/generic_utils.py
96 31 3
def update()
in flexflow/keras/utils/generic_utils.py
96 31 3
cc
void AdamOptimizer::update()
in src/runtime/optimizer.cc
89 5 1
cc
Tensor FFModel::create_tensor()
in src/runtime/model.cc
87 17 4
cc
87 23 3