scikit-hep / aghast

Aghast: aggregated, histogram-like statistics, sharable as Flatbuffers.
BSD 3-Clause "New" or "Revised" License
17 stars 8 forks source link

C++ layer under objects #5

Open jpivarski opened 5 years ago

jpivarski commented 5 years ago

This would replace the _fromflatbuffers pure-Python infrastructure with an extension module that uses C++ Flatbuffers generated code, bound to Python with pybind11. Objects made in Python and the _toflatbuffers methods would not be affected, but properties providing data from a buffer would not cache in Python, but deliver from the fast C++ every time.

Having a C++ layer would also open the door to fast adding (in "fast," "strict," and maybe even "adjust" modes). Not all functionality would be ported to the C++ layer, only those that would stand the most from this optimization.

The base C++ classes should be separately defined (header-only?), so that they can be reused in other C++ projects.