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

Road to 1.0. #95

Open
mikeb01 opened this issue Aug 13, 2021 · 3 comments
Open

Road to 1.0. #95

mikeb01 opened this issue Aug 13, 2021 · 3 comments

Comments

@mikeb01
Copy link
Contributor

mikeb01 commented Aug 13, 2021

The C implementation of HDR Histogram is fairly stable now, but there are a number of pending changes that should really be in place before making it a 1.0 version. The 3 outstanding features I think that should be required are:

  • packed arrays.
  • resizable counts.
  • double support.

However to complete this I think I would need to break the API to some degree. Mostly because the main struct is defined in the header which makes changing it potentially a breaking a change. To make future changes more flexible, I would like to make hdr_histogram an opaque point and hide the internal structure.

Feedback on how this may impact users would be appreciated. E.g. are there any users depending on stack allocation of the hdr_histogram?

Please reply to this issue if you have any issues or suggestions regarding the implementation for the next major revision of the HDR Histgoram.

@ahothan
Copy link
Contributor

ahothan commented Aug 13, 2021

This library is used by the Trex traffic generator (c++) and it does not rely on stack allocation.
The allocation is done by:

(private member of a class):
// Hdr histogram instance
hdr_histogram *m_hdrh;

(allocation):
int res = hdr_init(HDRH_LOWEST_TRACKABLE_VALUE, HDRH_HIGHEST_TRACKABLE_VALUE,
HDRH_SIGNIFICANT_DIGITS, &m_hdrh);

So should work fine if you make the struct opaque.

@natoscott
Copy link
Contributor

The library is also used in the Performance Co-Pilot suite, and it's the same situation there that @ahothan described - no problem with making the structure opaque.

@shuhaowu
Copy link

shuhaowu commented Aug 3, 2022

one potential use case of hdr histogram is to use it in real-time software, where worst-case latency must be known. An opaque pointer is likely fine, but recording values shouldn't result in some sort of internal resizing/allocation to enable that use case.

That said, I'm still evaluating HDR histogram in soft/hard real-time context, so I may be speaking too fast...

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

4 participants