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

Olly misreporting GC time #47

Open
kayceesrk opened this issue Jul 23, 2024 · 2 comments
Open

Olly misreporting GC time #47

kayceesrk opened this issue Jul 23, 2024 · 2 comments

Comments

@kayceesrk
Copy link
Collaborator

See description at https://roscidus.com/blog/blog/2024/07/22/performance-2/#:~:text=olly%20can%20be%20used%20get%20summary%20statistics%3A.

Todo: get reproduction steps.

CC @talex5.

@talex5
Copy link

talex5 commented Jul 24, 2024

Looks like Olly collects stats when it gets EV_RING_STOP, but the child might not have exited by then. This reproduces it for me:

let () =
  let domains = List.init 5 (fun _ ->
      Domain.spawn (fun () ->
          for _ = 1 to 10000000000 do
            ignore (Sys.opaque_identity (ref ()))
          done;
        )
    )
  in
  List.iter Domain.join domains;
  Printf.printf "gdb attach -p %d\n%!" (Unix.getpid ());
  Printf.printf "Then 'break exit' and 'continue'\n%!";
  Printf.printf "Quit gdb when it hits the break-point.\n%!";
  Unix.sleep 5

(the gdb thing is just to slow down the exit call a bit)

$ olly gc-stats './_build/default/main.exe'
gdb attach -p 271475             
Then 'break exit' and 'continue'
Quit gdb when it hits the break-point.

Execution times:
Wall time (s):	21.18
CPU time (s):	1.01
GC time (s):	16.17
GC overhead (% of CPU time):	1605.17%

@kayceesrk
Copy link
Collaborator Author

This was fixed at 6c61583, and the broken again at bc56d7b, both in the same PR #19. I'll reapply the fix.

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

2 participants