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

Some basic memory usage benchmarks. #271

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

ioquatix
Copy link
Member

@ioquatix ioquatix commented Aug 23, 2023

Compare memory usage of threads vs fibers.

cc @MatheusRich

Contribution


pid = fork do
fibers = 100.times.map do
Fiber.new{loop{Fiber.yield}}.resume

Choose a reason for hiding this comment

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

I might have missed something, but doesn't this only run once, while the thread example sleeps forever?

Copy link
Member Author

Choose a reason for hiding this comment

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

All the fibers and threads are still alive at the point where you measure memory usage. Does that seem sufficient?

@MatheusRich
Copy link

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.

2 participants