Python Forum
interpolation takes very long time
Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
interpolation takes very long time
#2
What length of the var_keys array?!
griddata should be fast, but you are trying to interpolate 8M points..!

Access to local variables via vars(), locals() is slower than direct access to them:
> python -m timeit -s "dct={'val': None}" "dct['val']=23"
Output:
0.0532 mu.sec per loop
> python -m timeit -s "val=0" "val=23"
Output:
0.023 mu.sec per loop
> python -m timeit -s "val=0" "vars()['val']=23"
Output:
0.325 mu.sec per loop
Even if we will not consider using vars()/locals() in terms of efficiency (it isn't efficient),
using it in such context is still bad practice: 1) it pollutes local environment with
new variables 2) it makes code harder to analyze (it might be not easy to imagine what variables exists)
and finally...
Reply


Messages In This Thread
interpolation takes very long time - by zengwl17206 - Aug-18-2018, 12:52 AM
RE: interpolation takes very long time - by scidam - Aug-18-2018, 05:37 AM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020