website icon indicating copy to clipboard operation
website copied to clipboard

Lines of code per second

Open todor2810 opened this issue 1 year ago • 5 comments

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

todor2810 avatar Jan 28 '23 13:01 todor2810

Did you do a release build of V with -prod?

medvednikov avatar Jan 28 '23 14:01 medvednikov

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).

todor2810 avatar Jan 28 '23 14:01 todor2810

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)

MatejMagat305 avatar Jan 28 '23 17:01 MatejMagat305

Cool @MatejMagat305

That's on par with the website's 500k loc/s with the tcc backend.

medvednikov avatar Jan 28 '23 23:01 medvednikov

@tedstoychev the hardware listed on the website is a bit more modern, hence the 2x speed diff.

medvednikov avatar Jan 28 '23 23:01 medvednikov