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

Optimise stub #5

Open
craff opened this issue Aug 4, 2023 · 5 comments
Open

Optimise stub #5

craff opened this issue Aug 4, 2023 · 5 comments

Comments

@craff
Copy link
Contributor

craff commented Aug 4, 2023

The function caml_polly_ctl and the three functions calling it could be called frequently in some applications. We could tag them with noalloc and untagged, raising the exception from OCaml in case of error ?

@craff
Copy link
Contributor Author

craff commented Aug 4, 2023

This is not really important for
simple_httpd as I am using ET and non blocking socket, I only need to
call epoll_add once for each socket. So this may wait, but if you like the idea, I will submit a PR.

@lindig
Copy link
Owner

lindig commented Aug 4, 2023

I have to think about this. I am motivated to support your use case because it complements our own, which is not high performance and quite limited. So I am interested how to improve performance without complicating the interface and how to improve general usability.

@craff
Copy link
Contributor Author

craff commented Aug 4, 2023

My proposal will not change the interface and reduce the size of the code, because it will move code from C to OCaml which is safer and more concise. The best is probably to discuss on the PR, I wont be vexed if the PR is finally not merges ;-)

@lindig
Copy link
Owner

lindig commented Aug 4, 2023

I looked at your code; a frequent operation is to calculate event sets. It would be possible to re-bind infix operators |, and & to make the code look more like C code instead of using land and lor

@craff
Copy link
Contributor Author

craff commented Aug 5, 2023

I submitted 2 PR... This will allow precise arguments #6 and #7

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