The Python component takes more than 2 seconds in computing simple statistics from just 220 numbers list: SlowPython.gh (13.5 KB). However, it should take just a few milliseconds instead…
It should only be slow when you first open the definition and the GHPython component executes the first time. If this is not the case, we’d need to know more about your setup (i.e. Rhino version etc.).
Edit: There’s definitely something fucky going on here. On my system the compute time increases each time the component executes. Perhaps it’s a memory leak related to the statistics module.
You´re right, the first time it takes around a couple of seconds, the second recomputation drops to a few milliseconds (as it should be), and next ones steadily increase run time. It is quite weird.
My Rhino version is 6 SR25. Please, let me know if you need anything else?
Perhaps I should use a different statistics module… any recommendation?
as you figured out yourself, this is likely a statistics module implementation problem. Maybe you could change the title to something more specific to attract more specific help.
To solve this, you can investigate what is going on, or try another module. I’m showing how to use .Net Numerics here, but for another purpose.
Means and medians are easy to compute in steps, too. And it could be a fun little exercise.
Thanks,
Giulio
–
Giulio Piacentino
for Robert McNeel & Associates giulio@mcneel.com
The speed problem is not so bad at this moment, just a bit annoying . I thought that it would have some straightforward solution but it seems some kind of bug.
As you said, such basic statistics are easy to compute so I will code them from scratch at some point. I think this will be the fastest approach.
In any case, when I have some time I think I will open a new more specific thread, just as a possible bug report in the statistics module.