@@ -14,7 +14,6 @@ Inspired by [tokei](https://github.com/Aaronepower/tokei).
1414require Go 1.19+
1515
1616```
17- # Go version >= 1.16
1817$ go install github.com/hhatto/gocloc/cmd/gocloc@latest
1918```
2019
@@ -87,80 +86,102 @@ $ gocloc --show-lang
8786
8887## Performance
8988* CPU 3.1GHz Intel Core i7 / 16GB 1600MHz DDR3 / MacOSX 10.11.3
90- * cloc 1.66
91- * tokei 1.5.1
89+ * cloc 1.96
90+ * tokei 12.1.2 compiled with serialization support: json
9291* gocloc [ 6a9d4f5] ( https://github.com/hhatto/gocloc/commit/6a9d4f5b3d4e5df28fe78a04e8741595e22ada50 )
9392* target repository is [ golang/go commit:633ab74] ( https://github.com/golang/go/tree/633ab7426a906b72dcf6f1d54e87f4ae926dc4e1 )
9493
9594### cloc
9695
9796```
9897$ time cloc .
99- 5171 text files.
100- 5052 unique files.
101- 420 files ignored.
102-
103- https://github.com/AlDanial/cloc v 1.66 T=23.31 s (204.0 files/s, 48203.3 lines/s)
98+ 12003 text files.
99+ 11150 unique files.
100+ 1192 files ignored.
101+
102+ 8 errors:
103+ Line count, exceeded timeout: ./src/cmd/dist/build.go
104+ Line count, exceeded timeout: ./src/cmd/trace/static/webcomponents.min.js
105+ Line count, exceeded timeout: ./src/net/http/requestwrite_test.go
106+ Line count, exceeded timeout: ./src/vendor/golang.org/x/net/idna/tables10.0.0.go
107+ Line count, exceeded timeout: ./src/vendor/golang.org/x/net/idna/tables11.0.0.go
108+ Line count, exceeded timeout: ./src/vendor/golang.org/x/net/idna/tables12.0.0.go
109+ Line count, exceeded timeout: ./src/vendor/golang.org/x/net/idna/tables13.0.0.go
110+ Line count, exceeded timeout: ./src/vendor/golang.org/x/net/idna/tables9.0.0.go
111+
112+ github.com/AlDanial/cloc v 1.96 T=35.07 s (317.9 files/s, 78679.3 lines/s)
104113-----------------------------------------------------------------------------------
105114Language files blank comment code
106115-----------------------------------------------------------------------------------
107- Go 4197 101140 125939 780280
108- Assembly 331 6128 14654 40531
109- HTML 41 4927 198 33316
110- C 90 1076 940 7390
111- Perl 12 185 177 1135
112- Bourne Again Shell 25 209 266 933
113- XML 4 85 9 623
114- Bourne Shell 8 71 302 467
115- Python 1 121 88 295
116- DOS Batch 5 55 1 238
117- JavaScript 4 48 122 231
118- C/C++ Header 15 50 147 211
119- CSS 3 51 9 176
120- yacc 1 27 20 155
121- Protocol Buffers 1 1 0 144
122- Windows Resource File 4 25 0 116
123- JSON 2 0 0 36
124- make 7 12 10 35
116+ Go 9081 205135 337681 1779107
117+ Text 1194 11530 0 210849
118+ Assembly 563 15549 21625 122329
119+ HTML 17 3197 78 24983
120+ C 139 1324 982 6895
121+ JSON 20 0 0 3122
122+ CSV 1 0 0 2119
123+ Markdown 27 674 106 1949
124+ Bourne Shell 16 253 868 1664
125+ JavaScript 10 234 221 1517
126+ Perl 10 173 171 1111
127+ C/C++ Header 26 145 346 724
128+ Bourne Again Shell 16 120 263 535
129+ Python 1 133 104 375
130+ CSS 3 4 13 337
131+ DOS Batch 5 56 66 207
132+ Windows Resource File 4 23 0 146
133+ Logos 2 16 0 101
134+ Dockerfile 2 13 15 47
135+ C++ 2 11 14 24
136+ make 5 9 10 21
137+ Objective-C 1 2 3 11
125138Fortran 90 2 1 3 8
126- C++ 1 3 5 7
127139awk 1 1 6 7
140+ YAML 1 0 0 5
141+ MATLAB 1 1 0 4
128142-----------------------------------------------------------------------------------
129- SUM: 4755 114216 142896 866334
143+ SUM: 11150 238604 362575 2158197
130144-----------------------------------------------------------------------------------
131- cloc . 13.57s user 7.89s system 105 % cpu 20.413 total
145+ cloc . 33.70s user 1.48s system 99 % cpu 35.237 total
132146```
133147
134148### tokei
135149
136150```
137- $ time tokei --sort code .
138- -------------------------------------------------------------------------------
139- Language Files Total Blanks Comments Code
140- -------------------------------------------------------------------------------
141- Go 4272 1027537 103241 150411 773970
142- Plain Text 28 0 0 0 137715
143- Assembly 334 61318 6130 0 55188
144- HTML 41 38441 4927 204 33316
145- C 92 9436 1081 946 7409
146- BASH 27 2134 260 570 1304
147- XML 4 717 85 9 623
148- Perl 10 1255 151 1096 343
149- Python 1 504 121 56 327
150- Batch 5 294 55 0 239
151- JavaScript 4 401 48 122 231
152- C Header 15 408 50 147 211
153- CSS 3 236 51 9 176
154- Protocol Buffers 1 145 1 0 144
155- Markdown 3 0 0 0 115
156- JSON 2 0 0 0 36
157- Makefile 7 57 13 10 34
158- FORTRAN Modern 2 12 1 3 8
159- C++ 1 15 3 5 7
160- -------------------------------------------------------------------------------
161- Total 4852 1142910 116218 153588 1011396
151+ $ time tokei --sort code --exclude "**/*.txt" .
152+ ===============================================================================
153+ Language Files Lines Code Comments Blanks
154+ ===============================================================================
155+ Go 9242 2330107 1812147 318036 199924
156+ GNU Style Assembly 565 159534 127093 16888 15553
157+ C 143 9272 6949 1000 1323
158+ JSON 21 3122 3122 0 0
159+ Shell 16 2785 2267 342 176
160+ JavaScript 10 1972 1520 218 234
161+ Perl 9 1360 1032 170 158
162+ C Header 27 1222 727 349 146
163+ BASH 16 918 521 279 118
164+ Python 1 612 421 70 121
165+ CSS 3 354 337 13 4
166+ Autoconf 9 283 274 0 9
167+ Batch 5 329 207 66 56
168+ Alex 2 117 101 0 16
169+ Dockerfile 2 75 47 15 13
170+ C++ 2 49 24 14 11
171+ Makefile 5 40 20 10 10
172+ Objective-C 2 21 15 3 3
173+ FORTRAN Modern 2 12 8 3 1
174+ Markdown 18 2402 0 1853 549
162175-------------------------------------------------------------------------------
163- tokei --sort code . 1.27s user 0.06s system 99% cpu 1.328 total
176+ HTML 17 19060 18584 49 427
177+ |- CSS 4 2071 1852 10 209
178+ |- HTML 1 219 212 0 7
179+ |- JavaScript 8 6920 6876 16 28
180+ (Total) 28270 27524 75 671
181+ ===============================================================================
182+ Total 10117 2533646 1975416 339378 218852
183+ ===============================================================================
184+ tokei --sort code --exclude "**/*.txt" . 0.76s user 0.50s system 562% cpu 0.224 total
164185```
165186
166187### gocloc
@@ -170,32 +191,30 @@ $ time gocloc --exclude-ext=txt .
170191-------------------------------------------------------------------------------
171192Language files blank comment code
172193-------------------------------------------------------------------------------
173- Go 4197 101140 133703 773058
174- Assembly 331 6128 14694 40510
175- HTML 41 4927 198 33316
176- C 90 1076 991 7389
177- BASH 28 257 539 1330
178- Perl 12 185 177 1135
179- XML 4 85 9 623
180- Python 1 121 88 295
181- Batch 5 55 1 238
182- JavaScript 4 48 122 231
183- C Header 15 50 147 211
184- CSS 3 51 9 176
185- Yacc 1 27 20 155
186- Protocol Buffers 1 1 0 144
187- Markdown 3 29 0 86
188- Plan9 Shell 4 25 42 74
189- Bourne Shell 5 23 29 70
190- JSON 2 0 0 36
191- make 7 13 10 34
194+ Go 9096 205242 352844 1764503
195+ Assembly 563 15555 21624 122324
196+ HTML 17 3197 212 24849
197+ C 139 1324 983 6894
198+ JSON 20 0 0 3122
199+ BASH 27 345 1106 2122
200+ Markdown 18 549 28 1825
201+ JavaScript 10 234 218 1520
202+ C Header 26 145 346 724
203+ Perl 10 173 584 698
204+ Python 1 133 104 375
205+ CSS 3 4 13 337
206+ Batch 5 56 0 273
207+ Plan9 Shell 4 23 50 96
208+ Bourne Shell 5 28 24 78
209+ C++ 2 11 14 24
210+ Makefile 5 10 10 20
211+ Objective-C 2 3 3 15
192212FORTRAN Modern 2 1 3 8
193213Awk 1 1 6 7
194- C++ 1 3 5 7
195214-------------------------------------------------------------------------------
196- TOTAL 4758 114246 150793 859133
215+ TOTAL 9956 227034 378172 1929814
197216-------------------------------------------------------------------------------
198- gocloc --exclude-ext=txt . 0.76s user 0.15s system 116 % cpu 0.775 total
217+ gocloc --exclude-ext=txt . 0.65s user 0.51s system 119 % cpu 0.970 total
199218```
200219
201220## License
0 commit comments