[GraphHopper] should GraphHopper stop to use assert?

Peter graphhopper at gmx.de
Wed Jun 10 08:14:46 UTC 2015


Hi John,

asserts are checked automatically when running the tests via maven, so
they are of some use there. And in critical code like DataAccess which
is called many many times in routing we need to avoid overhead which is
why we use asserts there. But I agree completely that always exceptions
should be used. Maybe you can try to replace with if statement +
exception and see if this has an impact on performance?

Kind Regards,
Peter

On 10.06.2015 00:55, John Zhao wrote:
> Hi,
>
> Assert in java need extra parameter to explicit enable it.
> Should GH just throw an exception directly?
>




More information about the GraphHopper mailing list