Open ianna opened 1 year ago
It looks like using a numba.typed.List
could improve a LayoutBuilder
performance:
MULTIPLIER 10000000
test_Numpy_LayoutBuilder()
Real time: 5.15 seconds
CPU time: 5.14 seconds
test_Numpy_LayoutBuilder()
Real time: 4.02 seconds
CPU time: 4.01 seconds
test_Numpy_ArrayBuilder()
Real time: 0.58 seconds
CPU time: 0.58 seconds
test_Numpy_ArrayBuilder()
Real time: 0.58 seconds
CPU time: 0.58 seconds
test_Numpy_TypedList()
Real time: 1.03 seconds
CPU time: 1.03 seconds
test_Numpy_TypedList()
Real time: 0.68 seconds
CPU time: 0.67 seconds
A benchmark from HDembinski. See the notebook
In [1]: import numba as nb
...: import numpy as np
...: import awkward as ak
...: print(f"{nb.__version__=}")
...: print(f"{ak.__version__=}")
...:
nb.__version__='0.58.0rc1'
ak.__version__='2.3.3'
Version of Awkward Array
2.3.1
Description and code to reproduce
@jpivarski - as discussed, I'm looking into the issue. Indeed, there is nearly 7x difference between an ArrayBuilder in Numba and a LayoutBuilder in Numba (the tests run twice to account for a "warm up"):
to build an array of five elements:
to build an array of 5x10e6 elements: