fedjabosnic / hotfix

Low latency fix engine for .net
GNU Lesser General Public License v3.0
16 stars 5 forks source link

Exception overhead #6

Open fedjabosnic opened 7 years ago

fedjabosnic commented 7 years ago

@GeorgeF0 From some simple experimentation, throwing/catching exceptions is pretty heavy relative to how quickly we can parse fix messages - parse failures cause a 10-40x spike in latency and a bunch of allocations to boot. As an example, average sized messages are successfully parsed in 1us but this spikes to 40us when a parsing exception occurs...

We should definitely stop using exceptions for control flow in the parsing functions but we might want to consider alternatives in the rest of the codebase too...

Definitely requires more benchmarks/tests as I've done very little...