Open Bug 1628553 Opened 5 years ago Updated 2 years ago

Revisit ProfileChunkedBuffer::GetState(), see if separate access would be better

Categories

(Core :: Gecko Profiler, task, P3)

task

Tracking

()

People

(Reporter: mozbugz, Unassigned)

References

Details

As Nazim said in https://phabricator.services.mozilla.com/D69493 , regarding the ProfileChunkedBuffer::State struct and the GetState() accessor:

Do you think it would be better to keep the values inside this struct directly also in this class instead of individual properties? Not sure how beneficial this could be though. It's more like a struct so we can return multiple values right now.

My thinking:
The main reasons I have this struct:

  • In lots of cases you probably need more than one of them, so it's more efficient to only lock once to copy everything, even if the caller doesn't use all of them.
  • It's the same API in BlocksRingBuffer, so it's easier to keep it as-is, at least for now.

So I'm opening this task to review this code, and based on actual usage, see if we'd better change it to individual member access.

Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.