4 ms·
Uh... No. You're off by an order of magnitude. $ cargo vendor $ tokei vendor/ crates/ -t Rust -s code --exclude winapi ----------------------------
by burntsushi 5y ago
Uh... No. You're off by an order of magnitude.
$ cargo vendor
$ tokei vendor/ crates/ -t Rust -s code --exclude winapi
-------------------------------------------------------------------------------
Language Files Lines Code Comments Blanks
-------------------------------------------------------------------------------
Rust 1248 615700 493777 83201 38722
And 8 minutes for compiling ripgrep sounds crazy. My i3 Mac Mini with 16GB of RAM compiles ripgrep from scratch in 1m48s.
- sodality2 5y agoWell, my laptop is AMD Athlon 3050U with ~3.33GB of ram ("4GB" but shared with GPU). Ripgrep definitely took that long to install last time I installed it. Dual core + ~3GB of ram, I can see 8 minutes being somewhat within reach. perhaps some aggro power throttling as well?
- jcelerier 5y agoI was on my phone and trusted the Google results of "ripgrep sloc", thanks for the correction ! What takes so much code in the ripgrep codebase ? I am developing a cross-platform GUI app with audio, video and network features and it's not even 500k lines
- jcelerier 5y agohmm, but I just cloned the ripgrep repo and it tells me 28k loc ? $ cloc . 193 text files. 170 unique files. 114 files ignored. github.com/AlDanial/cloc v 1.88 T=1.88 s (73.3 files/s, 25634.5 lines/s) -------------------------------------------------------------------------------- Language files blank comment code -------------------------------------------------------------------------------- Rust 85 3984 9128 28104 Markdown 19 923 0 3637 Python 2 194 313 830 TOML 13 42 11 342 YAML 3 30 60 313 Bourne Shell 8 22 9 130 zsh 1 16 14 67 Bourne Again Shell 2 11 22 28 Ruby 1 4 0 19 Dockerfile 4 4 0 12 -------------------------------------------------------------------------------- SUM: 138 5230 9557 33482 -------------------------------------------------------------------------------- isn't the crates thing counting dependencies too ? which would be weird, if so why not also count the libc or kernel32.dll source code ?
- burntsushi 5y agoI provided precisely the commands you need to run to get the output I got. Not only did you not run 'cargo vendor', but you're using 'cloc' instead of 'tokei', which has a less precise line counting algorithm.
- jcelerier 5y agobut, cargo vendor will fetch the dependencies, which should definitely not be counted as part of the source code of a given program ? else every program should also count the kernel, graphics driver, etc.. which would make it a pretty useless metric
- burntsushi 5y agoThis conversation is super frustrating. This is occurring in the context of compilation speed. So if you're measuring compilation speed by LoC (which is itself just a heuristic), then you should, at minimum, count as many lines of code that are actually being compiled. That's what `cargo vendor` does: it fetches the source code of all dependencies that are needed to build the project. You are losing sight of the forest through the trees here. This isn't an abstract argument about what is or isn't part of a program. This is a concrete measurement heuristic that has precisely defined inputs.
- jcelerier 5y ago.. you mean that the dependencies aren't downloaded as binaries but compiled from source every time ? damn
- burntsushi 5y agoI am counting the number of lines that are being compiled when you run 'cargo build' on Linux. This includes things like huge Unicode tables and ffi bindings (for the entirety of libc, for example).