pytorch / tensorpipe
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 981 units with 11,225 lines of code in units (52.5% of code).
    • 4 very long units (585 lines of code)
    • 20 long units (1,307 lines of code)
    • 114 medium size units (3,370 lines of code)
    • 192 small units (2,915 lines of code)
    • 651 very small units (3,048 lines of code)
5% | 11% | 30% | 25% | 27%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
cc6% | 15% | 34% | 25% | 17%
h0% | 0% | 15% | 27% | 57%
py0% | 0% | 88% | 0% | 11%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
tensorpipe/benchmark47% | 13% | 19% | 5% | 14%
tensorpipe/channel2% | 15% | 31% | 30% | 20%
tensorpipe/transport0% | 12% | 32% | 21% | 33%
tensorpipe/core0% | 20% | 40% | 20% | 18%
tensorpipe/common0% | 0% | 19% | 38% | 41%
tensorpipe/misc0% | 0% | 70% | 0% | 29%
tensorpipe/python0% | 0% | 51% | 18% | 29%
ROOT0% | 0% | 88% | 0% | 11%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
cc
static void clientPingPongNonBlock()
in tensorpipe/benchmark/benchmark_pipe.cc
212 30 6
cc
static void serverPongPingNonBlock()
in tensorpipe/benchmark/benchmark_pipe.cc
165 16 6
cc
struct Options parseOptions()
in tensorpipe/benchmark/options.cc
104 21 2
cc
std::shared_ptr ContextImpl::create()
in tensorpipe/channel/cma/context_impl.cc
104 18 0
94 5 1
cc
void ChannelImpl::advanceChunkRecvOperation()
in tensorpipe/channel/cuda_basic/channel_impl.cc
91 21 2
cc
void ChannelImpl::advanceChunkSendOperation()
in tensorpipe/channel/cuda_basic/channel_impl.cc
78 17 2
cc
void ConnectionImpl::initImplFromLoop()
in tensorpipe/transport/ibv/connection_impl.cc
74 6 0
cc
void PipeImpl::initFromLoop()
in tensorpipe/core/pipe_impl.cc
71 8 0
cc
static void runServer()
in tensorpipe/benchmark/benchmark_pipe.cc
67 5 1
cc
static void runClient()
in tensorpipe/benchmark/benchmark_pipe.cc
66 5 1
cc
bool Reactor::pollOnce()
in tensorpipe/transport/ibv/reactor.cc
66 12 0
cc
std::shared_ptr ContextImpl::create()
in tensorpipe/channel/cuda_ipc/context_impl.cc
65 7 0
cc
std::tuple lookupAddrForHostname()
in tensorpipe/transport/uv/utility.cc
64 8 0
cc
std::tuple lookupAddrLikeNccl()
in tensorpipe/transport/uv/utility.cc
64 20 1
cc
void PipeImpl::advanceReadOperation()
in tensorpipe/core/pipe_impl.cc
64 14 2
cc
Sockaddr Sockaddr::createInetSockAddr()
in tensorpipe/transport/ibv/sockaddr.cc
63 16 1
cc
void ChannelImpl::onReadHandshakeNumNics()
in tensorpipe/channel/cuda_gdr/channel_impl.cc
58 4 1
cc
void ChannelImpl::initImplFromLoop()
in tensorpipe/channel/mpt/channel_impl.cc
57 6 0
cc
std::shared_ptr ContextImpl::create()
in tensorpipe/channel/cuda_gdr/context_impl.cc
56 10 1