romange / helio

A modern framework for backend development based on io_uring Linux interface
Apache License 2.0
435 stars 49 forks source link

Add `SizeTrackingChannel` #170

Closed chakaz closed 10 months ago

chakaz commented 10 months ago

This type of channel is very similar to SimpleChannel, but it also tracks the size of Ts it owns.

codecov-commenter commented 10 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (57e34ef) 77.45% compared to head (e05641c) 77.45%.

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #170 +/- ## ======================================= Coverage 77.45% 77.45% ======================================= Files 98 98 Lines 7221 7221 ======================================= Hits 5593 5593 Misses 1628 1628 ``` [see 2 files with indirect coverage changes](https://app.codecov.io/gh/romange/helio/pull/170/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Roman+Gershman)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

chakaz commented 10 months ago

queue capacity * size of object is how much memory is used by the queue, am I missing something?

chakaz commented 10 months ago

I see what you may mean, I'll need to track each element's size as we save a string there as well :|

romange commented 10 months ago

If this object a string or any other object that uses heap then then the important bit is missing. We do not care about 'sizeof string * capacity'