-
Notifications
You must be signed in to change notification settings - Fork 4
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
Wait buffer #11
Wait buffer #11
Conversation
The allocation using |
Maybe |
Note that if you want the highest performance you should look at using
I have some benchmark code for a small HTTP load generator built using polly, but I don't have benchmark code for polly itself. IIRC 'polly' didn't show up in my performance profiles in a significant way, so I haven't looked at optimizing it, but I don't have concrete numbers at hand. When I have some time I can try to rerun the benchmarks and see how much time 'Polly.wait_fold' and 'Polly.upd' takes up. |
It is still scanned by the minor GC? I was going to benchmark, but I forgot the power outlet of my laptop.
Le 6 août 2023 08:12:19 GMT-10:00, Christian Lindig ***@***.***> a écrit :
…The allocation using `alloca` on the C stack is basically cost free and cheaper than any other form of allocation either using malloc or using the OCaml heap because the latter requires garbage collection. Allocation with `alloca` is just a pointer operation and memory is freed as soon as possible. The fact that this buffer is allocated at every invocation of `epoll_wait` and does not survive the call is irrelevant. I don't believe that pre-allocating a buffer which is GC'ed later is cheaper or faster. So this would require a benchmark to convince me otherwise.
--
Reply to this email directly or view it on GitHub:
#11 (comment)
You are receiving this because you authored the thread.
Message ID: ***@***.***>
|
Maybe my understanding is wrong (@edwintorok please correct me), but |
Isn't there a bzero at stack allocation or deallocation?
Le 6 août 2023 08:12:19 GMT-10:00, Christian Lindig ***@***.***> a écrit :
…The allocation using `alloca` on the C stack is basically cost free and cheaper than any other form of allocation either using malloc or using the OCaml heap because the latter requires garbage collection. Allocation with `alloca` is just a pointer operation and memory is freed as soon as possible. The fact that this buffer is allocated at every invocation of `epoll_wait` and does not survive the call is irrelevant. I don't believe that pre-allocating a buffer which is GC'ed later is cheaper or faster. So this would require a benchmark to convince me otherwise.
--
Reply to this email directly or view it on GitHub:
#11 (comment)
You are receiving this because you authored the thread.
Message ID: ***@***.***>
|
Variables allocated on the stack are uninitialized, there is no need for a
|
Thanks for the information. This PR is therefore clearly useless. I close it. |
Introduces EventBuffer to avoid allocating at each wait/wait_fold.
Warning: This PR is based on constant3 (PR#10) and not master, because I added one line in src/constants.ml
Questions:
EventBuffer.t = int * Bytes.t
or justBytes.t
and to a division to compute val_max ?