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

D frameworks #6488

Merged
merged 26 commits into from
Jul 21, 2023
Merged

D frameworks #6488

merged 26 commits into from
Jul 21, 2023

Conversation

cyrusmsk
Copy link
Contributor

@cyrusmsk cyrusmsk commented Jul 4, 2023

Added 3 more frameworks:

  • arsd:cgi
  • handy-https
  • lighttp
    Also small changes to archttp and Docker file (for latest version of LDC).

Please review and test to approve the PR into master branch.

Two authors of framework (handy and arsd:cgi) agreed to add their framework to bench.
I also added threads to archttp - probably it will improve results.
Lighttp - simple and straightforward framework that was abandoned by the original author, bit it is still working.
Also I propose to use dlangchina containter for Docker - it should use more modern version of LDC compiler. At least for the time when official containers for D will be ready (WIP now)
2.096 - is the version of DMD reference compiler. LDC - LLVM backend has different structure of the semver.
@cyrusmsk cyrusmsk requested a review from waghanza as a code owner July 4, 2023 20:07
@waghanza
Copy link
Collaborator

waghanza commented Jul 5, 2023

@adamdruppe @andrewlalis @Kripth we are going to add those framework in here. is it ok for you ?

d/Dockerfile Show resolved Hide resolved
d/Dockerfile Outdated Show resolved Hide resolved
@@ -1,7 +1,9 @@
{
"name": "server",
"dependencies": {
"archttp": "~>1.1.1"
"archttp": "~>1.1.1",
"mir-cpuid": "~>1.2.10"
Copy link
Collaborator

Choose a reason for hiding this comment

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

is it a common usage ? I mean physical resources handling should not be a part of the framework / language ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Probably it will work without it. I've just took it from other repo: https://github.com/tchaloupka/httpbench/tree/master/dlang/archttp

Copy link
Collaborator

Choose a reason for hiding this comment

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

seems like a hack for me, I prefer no to, but let's check with @zoujiaqing

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I propose to try with this one. In case it doesn't give any value - we can remove it.

d/cgi/config.yaml Outdated Show resolved Hide resolved
d/config.yaml Outdated
@@ -1,5 +1,5 @@
language:
version: 2.096
version: 1.32.2
Copy link
Collaborator

Choose a reason for hiding this comment

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

?

ℹ️ Not sure how to determine language version

Copy link
Contributor Author

Choose a reason for hiding this comment

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

D has several compilers.
DMD has versions 2.XXX - now it is 2.104 https://dlang.org/download.html#dmd
LDC (based on LLVM) has different versions. The latest is 1.32.2 https://github.com/ldc-developers/ldc/releases

Copy link
Collaborator

Choose a reason for hiding this comment

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

If using ldc package of debian, how can we be sure of version number (of the language) ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I just saw that C uses Debian as well. So you are right - we can rely only on version from the package. Could we use it as temporary decision? While the updated versions of official (or at least community-driven) docker images are under preparation?

d/handy/config.yaml Outdated Show resolved Hide resolved
d/lighttp/config.yaml Outdated Show resolved Hide resolved
@adamdruppe
Copy link

yeah i think benchmarks are generally silly and useless (they are so far away from any real world concerns) but i don't mind them being there.

@cyrusmsk
Copy link
Contributor Author

cyrusmsk commented Jul 5, 2023

@adamdruppe @andrewlalis @Kripth we are going to add those framework in here. is it ok for you ?

The approve from Andrew is here: andrewlalis/handy-httpd#20

@cyrusmsk
Copy link
Contributor Author

@waghanza do you know the error with wrong URL?
docker run -p 3000:3000 -td d.archttp.default > d/archttp/cid-default.txt
docker inspect cat d/archttp/cid-default.txt | jq -r '.[0].NetworkSettings.IPAddress' > d/archttp/ip-default.txt
curl --retry 5 --retry-delay 5 --retry-max-time 180 --retry-connrefused http://cat d/archttp/ip-default.txt:3000 -v

  • Closing connection -1
    curl: (3) URL using bad/illegal format or missing URL

Don't know how to fix it.

@waghanza
Copy link
Collaborator

Maybe if server is not listening to 0.0.0.0 inside the container, and on port 3000 @cyrusmsk

@cyrusmsk
Copy link
Contributor Author

It seems problem in Docker configuration. If I will use old ubuntu-based two solutions passed tests successfully. But now I'm trying to use Alpine image and faced with this problem.

@cyrusmsk
Copy link
Contributor Author

Maybe if server is not listening to 0.0.0.0 inside the container, and on port 3000 @cyrusmsk

is it possible to echo/cat the file 'd/archttp/ip-default.txt' somehow with Docker command?
I can't understand where is everything is running.
Who is giving CMD command?

@cyrusmsk
Copy link
Contributor Author

Ok, with last commit everything passed tests: https://github.com/cyrusmsk/web-frameworks/actions/runs/5592528052/jobs/10225103834
Please review now @waghanza

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.

Are you sure that ldc provided by debian side use d lang version 1.32 @cyrusmsk ?
https://packages.debian.org/unstable/ldc

Change language version and move to Devian bookworm
@cyrusmsk
Copy link
Contributor Author

Are you sure that ldc provided by debian side use d lang version 1.32 @cyrusmsk ?
https://packages.debian.org/unstable/ldc

Fixed to 1.30.0. And also I saw that you are planning to move other Debian based images to Bookworm, so I've change the container to Bookworm as well. All tests are passed https://github.com/cyrusmsk/web-frameworks/actions/runs/5602125606 in local repo.

@waghanza
Copy link
Collaborator

Could you use multi-layer container @cyrusmsk ?

@cyrusmsk
Copy link
Contributor Author

Could you use multi-layer container @cyrusmsk ?

Updated to multi-stage container. But because D need runtime - it still required ldc package to run. Probably it is possible to build static executables, but I haven't tested them for HTTPs frameworks. Test locally run here https://github.com/cyrusmsk/web-frameworks/actions/runs/5603841227

@cyrusmsk
Copy link
Contributor Author

Hi @waghanza
Anything else should be added to be merged? Please let me know

@waghanza waghanza mentioned this pull request Jul 21, 2023
@waghanza waghanza merged commit 3de2fb9 into the-benchmarker:master Jul 21, 2023
19 checks passed
@cyrusmsk cyrusmsk deleted the d_frameworks branch July 21, 2023 17:34
@waghanza waghanza mentioned this pull request Sep 4, 2023
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.

3 participants