[esnacc-dev] [PATCH] cxx-lib: do not use exceptions in performance critical operators

Kovács László laszlo.kovacs at neti.com
Wed Mar 22 12:27:56 UTC 2017


In asn-buf.cpp the operator<() and the operator==() methods 
suffer from a performance issue, they are running in a loop until 
an exception is not thrown. This is a very bad idea, and very 
inefficient way of error handling. I have done some performance 
tests with gproof. The performance has improved about 4 times better, 
the code runs faster after my fix. I removed the exception handling from 
operator<() and the operator==() and replaced them to a 
boolean function, that can signal if an exception would be thrown.

Signed-off-by: László Kovács <sabbath24 at gmail.com>
---
Patch was added in an attachment.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.esnacc.org/pipermail/dev/attachments/20170322/834f15be/attachment-0002.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: esnacc-remove-exceptions-at-operators.patch
Type: text/x-patch
Size: 2987 bytes
Desc: not available
URL: <http://mail.esnacc.org/pipermail/dev/attachments/20170322/834f15be/attachment-0002.bin>


More information about the dev mailing list