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

Performance comparsion with aiofiles #16

Closed
diogommartins opened this issue Dec 23, 2018 · 3 comments
Closed

Performance comparsion with aiofiles #16

diogommartins opened this issue Dec 23, 2018 · 3 comments

Comments

@diogommartins
Copy link

I'm considering using aiofile for the FileHandler implementation of aiologger. Could you help me with the pros and cons comparing aiofile with aiofiles threadpool implementation ?

@mosquito
Copy link
Owner

@daltonmatos the Linux aio.h implementation uses thread pool under the hood. You could read complete explanation here https://stackoverflow.com/a/8782305.

The mosquito/aiofile has aio.h binding. And so it turns out that it works with internal system thread pool.
The main advantage it's a this implementation is that it releases the GIL. It's reasonable if you try to run many event-loop instances in the different threads.

On my tests, I don't see the performance increase. Moreover when the chunks are small this is slower than thread-pool implementation.

IMHO: The one better thing is aio_fsync. It's a real do syncing file to the filesystem and on my experiments with raspberry pi after call aio_fsync a file was really stored on SD-card.

By the way, I will be experimenting with libaio (not aio.h), but not yet.

@daltonmatos
Copy link

Thanks @mosquito for your response.

@diogommartins, do you think this issue could be closed?

Thanks.

@diogommartins
Copy link
Author

Thanks a lot, @mosquito !

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