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

Add more stress tests and benchmarks #450

Open
Tracked by #388
talex5 opened this issue Feb 25, 2023 · 12 comments
Open
Tracked by #388

Add more stress tests and benchmarks #450

talex5 opened this issue Feb 25, 2023 · 12 comments
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@talex5
Copy link
Collaborator

talex5 commented Feb 25, 2023

The only stress test we have is stress_semaphore.ml and the benchmarks mostly test the synchronisation primitives but not the OS integration (except for bench_fd.ml, which tests reading from /dev/zero). We need more.

In particular, we have found several resource leaks and races when e.g. spawning and joining domains in a tight loop (e.g. #421). The https://github.com/ocaml-multicore/retro-httpaf-bench/tree/master/cohttp-eio benchmark is useful; more like that (or simpler) would be good. (update: we now have bench_http.ml for this)

Testing for FD leaks would also be worth doing. e.g. checking that we have the same number of open FDs at the end of running the tests.

It would be very interesting to look at the benchmarks with e.g. https://magic-trace.org/ to see if there are obvious inefficiencies left.

The benchmarks could go in this repository (if simple) or we could create a new project just for that (if they have lots of dependencies).

Stress testing https://github.com/ocaml-multicore/lwt_eio would be useful too.

@talex5 talex5 added enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed labels Feb 25, 2023
@talex5 talex5 mentioned this issue Feb 25, 2023
25 tasks
@balat balat added this to the Eio 1.0 milestone May 12, 2023
@kayceesrk kayceesrk moved this to Todo in hackocaml Feb 19, 2024
@RichardChukwu
Copy link

RichardChukwu commented Oct 2, 2024

Hello @patricoferris @talex5 I'm an outreachy december 2024 cohort appplicant. I'm interested in contributing to this issue please with your assistance.

Attached is a screenshot of my terminal running the Eio "Hello World" example in utop.[
Ocaml Setup

@oyenuga17
Copy link

@RichardChukwu please you can go ahead you'll be assigned the issue.

@talex5
Copy link
Collaborator Author

talex5 commented Oct 3, 2024

@RichardChukwu that screenshot doesn't show running the Eio hello world (https://github.com/ocaml-multicore/eio/blob/main/examples/hello/main.ml). It's just using print_screen.

@talex5
Copy link
Collaborator Author

talex5 commented Oct 3, 2024

For finding performance problems in Eio, there's lots of information about available tools at https://roscidus.com/blog/blog/2024/07/22/performance/ (though many of them are Linux-only).

It would also be good to run statmemprof on some of the benchmarks to see if there are places where too much allocation is happening (this requires using OCaml 5.3 or the backport to 5.2).

@RichardChukwu
Copy link

@RichardChukwu that screenshot doesn't show running the Eio hello world (https://github.com/ocaml-multicore/eio/blob/main/examples/hello/main.ml). It's just using print_screen.

Ok I'll resend another running the exact Eio hello world

@oyenuga17
Copy link

@talex5 oh my bad that was my mistake @RichardChukwu when you have Eio running it should look like this

Screenshot 2024-10-02 052349

@RichardChukwu
Copy link

Thank you for the correction @oyenuga17 I'll resend immediately with correct setup screenshot

@RichardChukwu
Copy link

RichardChukwu commented Oct 3, 2024

Hello @talex5 @oyenuga17 took the feedback and ran the Eio hello world program again, here is a screenshot attached. I'm ready to be assigned this issue now.
ocaml setup Richard

@oyenuga17
Copy link

@RichardChukwu please go ahead with the task you'll be assigned.

@RichardChukwu
Copy link

Aright, on it @oyenuga17 thanks for the response

@patricoferris
Copy link
Collaborator

Awesome @RichardChukwu !

This issue is pretty generic. Do you have a concrete idea of the kinds of benchmarks you think we can add?

Perhaps focusing on the open FD test that @talex5 mentioned above would be a good idea? Note that this issue has nothing directly to do with Windows, so feel free to give it a go in the environment you are most comfortable with.

@RichardChukwu
Copy link

Hello @patricoferris yeah, here's an idea I'd like to work on:

Stress Test for FD Leaks: stress_fd_leak.ml

This test will ensure that the number of open file descriptors (FDs) remains the same at the beginning and end of the test, indicating no FD leaks.

I think this will help me get started working on the Eio library before delving into more windows specific Eio tasks.

@talex5 talex5 removed this from the 1.0 milestone Oct 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

5 participants