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

V: pure v server #7932

Merged
merged 22 commits into from
Dec 8, 2024
Merged

V: pure v server #7932

merged 22 commits into from
Dec 8, 2024

Conversation

enghitalo
Copy link
Contributor

@enghitalo enghitalo commented Nov 7, 2024

challenge to make V top 1, and then rewrite the veb library

Local results

v wipe-cache && v -prod -gc none -d no_bounds_checking crun .

wrk --header 'Connection: keep-alive' --connections 512 --threads 16 --duration 30s --timeout 1m http://localhost:3000/
Running 30s test @ http://localhost:3000/
  16 threads and 512 connections
^C  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency     1.36ms    1.37ms  22.13ms   86.44%
    Req/Sec    27.40k     1.93k   41.81k    73.89%
  11572012 requests in 26.56s, 1.01GB read
Requests/sec: 435704.00
Transfer/sec:     39.06MB

v wipe-cache && v -prod crun .

wrk --header 'Connection: keep-alive' --connections 512 --threads 16 --duration 30s --timeout 1m http://localhost:3000/
Running 30s test @ http://localhost:3000/
  16 threads and 512 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency   876.87ms    2.07s   18.24s    88.71%
    Req/Sec    20.68k     7.18k   48.84k    73.25%
  9871316 requests in 30.10s, 0.86GB read
Requests/sec: 327950.45
Transfer/sec:     29.40MB

@enghitalo enghitalo requested a review from waghanza as a code owner November 7, 2024 18:12
@enghitalo enghitalo changed the title V/pure v server V: pure v server (challenge to make V top 1) Nov 7, 2024
@@ -0,0 +1,291 @@
// This module implements a basic HTTP server using epoll for handling multiple client connections efficiently.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be named server.c.v

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you do not change the name of this file, it will fail to compile when V changes the default so that files with C. references in them must have .c.v extension.

@waghanza
Copy link
Collaborator

waghanza commented Nov 7, 2024

Maybe use v instead of vanilla for the reference implementation

@enghitalo enghitalo marked this pull request as draft November 7, 2024 20:26
@enghitalo enghitalo marked this pull request as ready for review November 8, 2024 01:55
@enghitalo
Copy link
Contributor Author

╰─ wrk -t16 -c512 -d30s http://127.0.0.1:3000/ ─╯
Running 30s test @ http://127.0.0.1:3000/
  16 threads and 512 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency     2.58ms    1.91ms  16.50ms   71.88%
    Req/Sec    13.47k   627.78    25.90k    78.45%
  6450599 requests in 30.10s, 578.27MB read
Requests/sec: 214307.56
Transfer/sec:     19.21MB

@enghitalo enghitalo changed the title V: pure v server (challenge to make V top 1) V: pure v server Nov 9, 2024
Copy link
Collaborator

@waghanza waghanza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cyrusmsk
Copy link
Contributor

cyrusmsk commented Nov 9, 2024

I'm not sure that such low-level unsafe and "static" (return string instead of generated HTTP response) implementation should be used in the benchmark

@waghanza
Copy link
Collaborator

You say @cyrusmsk , that having such an implementation is not usefull here.

It's quite the opposite for me. I think this raw implementation (v here) is useful when comparing other with v frameworks, not very useful when you compare with ruby based frameworks (example)

@cyrusmsk
Copy link
Contributor

You say @cyrusmsk , that having such an implementation is not usefull here.

It's quite the opposite for me. I think this raw implementation (v here) is useful when comparing other with v frameworks, not very useful when you compare with ruby based frameworks (example)

I just followed initial message (written somewhere) that the idea of the project is to have production-ready solutions.
And I don't see why the overall code couldn't be prepared as a library and installed from package management of V and used as other libraries (having only high level interface for the user).

@waghanza
Copy link
Collaborator

You have a point.

The main goal of this project is to compare web frameworks, so as you can decide wich to choose (if you want to migrate, or create a new project with a business idea or not).

However, to make great framework, contributors need to compare with some reference implementation (in this case pure v for v based frameworks).

For this it could be valuable, but indeed not got the primary goal.

@enghitalo
Copy link
Contributor Author

My intention with this project is to take advantage of Mr. @waghanza 's incredible project to have a standardized reference point between our frameworks and the frameworks of other projects in other languages ​​and, thus, be able to outline, in a more coherent way, the performance improvements that we can have within the Language.

@enghitalo enghitalo marked this pull request as draft November 11, 2024 01:54
@ylluminate
Copy link

I think @enghitalo's goal is spot on here. The idea of a "vanilla" (non veb-based in this case) starting point is of value and then from there it appears that he will implement a veb-based version (since that is the primarily official "batteries included" option) and perhaps other V-based frameworks.

@waghanza
Copy link
Collaborator

Let's fix the CI and I will update results today 😌

@cyrusmsk
Copy link
Contributor

My intention

It is clear and a nice target, I agree. Why not create a separate V package? and put all low-level code over there and provide only high-level interface to it?

@enghitalo
Copy link
Contributor Author

My intention

It is clear and a nice target, I agree. Why not create a separate V package? and put all low-level code over there and provide only high-level interface to it?

Soon

@waghanza waghanza mentioned this pull request Nov 26, 2024
10 tasks
@enghitalo enghitalo marked this pull request as ready for review December 7, 2024 18:12
v/v/src/controllers.v Outdated Show resolved Hide resolved
@@ -1,10 +1,10 @@
language:
version: "weekly.2024.49"
version: "latest"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could master be considered as stable ?

I mean since v is not at 1.0, it could be ok to point to master, but it could be inconvenient to fix compilation issues (or else) in there is some

Copy link

@ylluminate ylluminate Dec 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That seems reasonable to me. V is so fast moving at the moment that this definitely makes sense @waghanza. I frankly don't think anyone is going to want to support older snapshots with so many updates coming in constantly and consistently... but I should defer to @enghitalo on his intention here.

Copy link
Contributor Author

@enghitalo enghitalo Dec 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@waghanza For now, master is as stable as previous releases. I changed to master because "weekly.2024.49" is breaking the CI.

@waghanza waghanza merged commit 76c7c03 into the-benchmarker:master Dec 8, 2024
5 checks passed
@ylluminate
Copy link

Good work @enghitalo!

@enghitalo
Copy link
Contributor Author

Good work @enghitalo!

Thank you!

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

Successfully merging this pull request may close these issues.

5 participants