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

Eio.Flow.copy is very slow on mac OS #453

Closed
jinwoo opened this issue Mar 6, 2023 · 4 comments
Closed

Eio.Flow.copy is very slow on mac OS #453

jinwoo opened this issue Mar 6, 2023 · 4 comments

Comments

@jinwoo
Copy link

jinwoo commented Mar 6, 2023

I ran one of the examples from the README file on my macbook.

let () =
  Eio_main.run @@ fun env ->
  Eio.Flow.copy
    (Eio.Stdenv.stdin env)
    (Eio.Stdenv.stdout env)

Compiling and running this code took ~38 sec against a 10G file while the standard library version only took ~2 sec.

Is this a limitation of the eio_luv backend?

@talex5
Copy link
Collaborator

talex5 commented Mar 6, 2023

Could you try it with the posix backend (#448) and see if that helps?

@patricoferris
Copy link
Collaborator

patricoferris commented Mar 24, 2023

Took this for a spin on a mac (M1) and indeed see a noticeable improvement using the posix backend over libuv.

With Eio_luv:

truncate -s 2G dummy
_build/default/main.exe <dummy | pv >/dev/null
2.00GiB 0:00:13 [ 148MiB/s]

And then with Eio_posix:

truncate -s 2G dummy
_build/default/main.exe <dummy | pv >/dev/null
2.00GiB 0:00:03 [ 569MiB/s]

Whilst having a look I noticed the README still talks about this benchmark in terms of Eio_linux's use of splice but iiuc as of #327 this is not the case, perhaps we should comment that out for now?

@talex5
Copy link
Collaborator

talex5 commented Mar 24, 2023

Yeah, we should probably replace that section with a graph from https://github.com/ocaml-multicore/retro-httpaf-bench (there are some updates on my https://github.com/talex5/retro-httpaf-bench/tree/eio branch that need merging first though).

@talex5
Copy link
Collaborator

talex5 commented Apr 13, 2023

With Eio 0.9, macOS will be using the eio_posix backend now and the problem should be fixed.

@talex5 talex5 closed this as completed Apr 13, 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

No branches or pull requests

3 participants