Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lines of code per second #238

Open
todor2810 opened this issue Jan 28, 2023 · 5 comments
Open

Lines of code per second #238

todor2810 opened this issue Jan 28, 2023 · 5 comments

Comments

@todor2810
Copy link

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

@medvednikov
Copy link
Member

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

@todor2810
Copy link
Author

todor2810 commented Jan 28, 2023

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

@MatejMagat305
Copy link

MatejMagat305 commented Jan 28, 2023

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)

@medvednikov
Copy link
Member

Cool @MatejMagat305

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

@medvednikov
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants