website
website copied to clipboard
Lines of code per second
On the front page (https://vlang.io/) it says:
V compiles ≈110k (Clang backend) lines of code per second (Intel i5-7500, SM0256L SSD, no optimization)
However when I try to reproduce this I get ≈40k LOC/s (i.e. ≈25s in total). Steps I made:
- downloaded tools/gen1m.v
- ran
v run gen1m.v > result.v
- ran
time v result.v
System info:
- MacBook Pro 13" (2015) (Intel i5 2.9 GHz, SM0512G SSD)
- V v0.3.2 d3e4058
- Clang compiler
Would it be a good idea to change the phrasing to:
V compiles up to ≈110k (Clang backend) lines of code per second
Did you do a release build of V with -prod?
I didn't. I just ran:
v -prod self
followed by the previous steps. The compilation speed for result.v
increased from ~40k LOC/s to ~45k LOC/s (~22s in total).
well I know I have "beast" pc
OS: linux, Kali GNU/Linux Rolling
Processor: 32 cpus, 64bit, little endian, AMD Ryzen 9 5950X 16-Core Processor
CC version: cc (Debian 12.2.0-13) 12.2.0
getwd: /home/matejmag/Documents/v/examples/focus
vmodules: /home/matejmag/.vmodules
vroot: /home/matejmag/Documents/v
vexe: /home/matejmag/Documents/v/v
vexe mtime: 2023-01-28 16:17:14
is vroot writable: true
is vmodules writable: true
V full version: V 0.3.2 1d4fd53.d3e4058
Git version: git version 2.39.0
Git vroot status: weekly.2023.04-18-gd3e4058a
.git/config present: true
thirdparty/tcc status: thirdparty-linux-amd64 12f392c3
almost 4 GZ, but I have with "v self -prod"
real 1.69s
user 1.48s
sys 0.24s
cpu 102%
that means almost 591716 line / s (591K LOC / s)
Cool @MatejMagat305
That's on par with the website's 500k loc/s with the tcc backend.
@tedstoychev the hardware listed on the website is a bit more modern, hence the 2x speed diff.