mtbc: photograph of me (0)
Mark T. B. Carroll ([personal profile] mtbc) wrote 2017-11-29 07:56 pm (UTC)

Fortunately I need the BigInteger bit rather rarely, just when I bother writing the current counts to logs (currently several times per minute). Given that I don't need the BigInteger to do the increment, I'm not sure why my increment code would be expensive: it'll typically return in the first loop iteration? The worst I can see is it does have to look at the array, which will be on the heap rather than passed on the stack, but I would guess that a LongLong's fields would be likewise. (I'm guessing that index just ends up as a register.)

It may not actually be much more than a few tens of thousands of increments per second which of course by modern standards is nothing, but I've not worked hard to be sure of an upper limit and we seem to increase the scale of data we want to push through the system faster than we can comfortably scale the system itself, so I'm worried that we may be up some orders of magnitude before anybody ever looks again at the code.

Update: Ah, I realize I was probably unclear: when I write of returning the BigInteger, I didn't mean from the increment method: I probably snipped too much context!

Post a comment in response:

This account has disabled anonymous posting.
(will be screened if not on Access List)
(will be screened if not on Access List)
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting

If you are unable to use this captcha for any reason, please contact us by email at support@dreamwidth.org