Skip to content
Snippets Groups Projects
Commit 0aeffb16 authored by Wolfgang Kastaun's avatar Wolfgang Kastaun
Browse files

Performance optimization of interpolator to prevent annoying slowdown of small test problems

Repeating small tests many times was order of magnitude slower. The reason is the computation of
Lagrange polynomials was both inefficient and performed every time an RegularInterpLagrange instance was
created. This causes overhead which is not relevant for large problem sizes but makes running many small
tests slow. The fix for now is to cache the creation of the polynomials. Now they are created only onnce
for each interpolation order, but not once per instance.
parent 8423b4d7
No related branches found
No related tags found
No related merge requests found
......@@ -155,6 +155,7 @@ class RegularInterpLagrange(RegularInterpCore):
"""
@staticmethod
@functools.cache
def _make_firs(length: int, offset: int) -> list[FilterFirNumpyType]:
"""Set up lagrange polynomials and convert coefficients to FIR filters"""
plag = make_lagrange_polynomials(length, offset)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment