Open source

View source

bnglatlon-cpp

British National Grid to WGS84 conversion, rewritten from Python to C++ and benchmarked.

bnglatlon-cpp converts coordinates between British National Grid (OSGB36) and latitude and longitude (WGS84). It is a C++ implementation of the Python module fmalina/blocl-bnglatlon, packaged as a Python extension.

1

Results

Over 100 runs, the C++ version used about 91% less CPU time than the Python version, with almost no change in memory use.

ItemCPU time (× 10⁻⁴ seconds)Memory (MiB)
Python9.2745820.828125
C++0.8195820.812500
2

Write-up

The full account is in Rewriting Python Modules in C++, for a Performance Boost.