Closed repnop closed 3 weeks ago
it was unrelated, but while investigating failing tests, I noticed a bug in the DecodeError
display impl which accidentally printed the self.kind
instead of self.codec
for the Codec:
message, so I included that here as well.
Nice! The performance boost seems to be similar compared what I was doing. I am not sure if it is easy to get faster from integers alone, without changing the logic how constraints are handled. There are a lot of other allocations too, so in general decoding integers alone are not that visible, at least based on my debugging and benchmarking.
but I can perform more performance analysis at some point in the future that specifically looks at the integer decoding alone.
You can reuse the pure integer bench from here: https://github.com/Nicceboy/rasn/blob/integer-remake/benches/integer.rs
It is significant for Integer type (M2 Pro machine):
Thought, BER decoding seems to panic on that bench now.
Nice! The performance boost seems to be similar compared what I was doing. I am not sure if it is easy to get faster from integers alone, without changing the logic how constraints are handled. There are a lot of other allocations too, so in general decoding integers alone are not that visible, at least based on my debugging and benchmarking.
yeah it is kind of a microbenchmark with what I have, I'll try to recreate my original NetSNMP benchmark comparison next week sometime to see how that fairs and perhaps try to stand up something that collects some real-world performance data with SNMP devices I have access to at work to get a better idea of where things could be improved in general as well.
but I can perform more performance analysis at some point in the future that specifically looks at the integer decoding alone.
You can reuse the pure integer bench from here: https://github.com/Nicceboy/rasn/blob/integer-remake/benches/integer.rs
great to know about, thanks! I'll definitely give it a look
It is significant for Integer type (M2 Pro machine):
now those are the numbers I like to see 👀 awesome, thanks for trying it out!
Thank you for your PR!
I think there's a bug with the decoding logic that causes a panic (which looks to be the same source as in Nicceboy's benchmark), I need to figure out the source but I'll put in a PR with that fix here shortly hopefully. not sure if its worth yanking 0.15.1 for the time being
there's some outstanding concerns around behavior, though all of the tests do pass. mainly, with the
wrapping_add
in the PERparse_integer
method, and with theas
casts in the integer typeIntegerType
trait impls as well, but it seems to be working assuming the tests cover enough ground. current preliminary benchmarks seem promising (after modifying thecommon.rs
file inmain
to include integer benchmarking), though maybe not quite as significant as I had hoped, but I can perform more performance analysis at some point in the future that specifically looks at the integer decoding alone.my laptop info for this benchmark run:
before
after