Howdy Data Folks - Benchmarking R/Python workflows on #FreeBSD 14.1 and #Debian Stable (12.5) on an 8-core Intel machine. Performance in R is comparable (R is faster on FreeBSD, but it isn't statistically significant). But latency for Python 3.9.18 on FreeBSD is terrible compared to Debian. It gets worse the more CPU cores you use. This was unexpected (for me). Is this a known issue with Python 3.9 on FreeBSD?

Breadcrumbs: If you switch pkg from QUARTERLY to LATEST on 14.1, you can install the Python 3.11.9 runtime (and dependencies) without having to run 15.0 (CURRENT). My install of 14.1 defaults to 3.9 (and quarterly), perhaps they are getting ready to move 3.11 in the next release? Dunno.

There are no real tunables for scikit-learn in FreeBSD ports Makefile. It's just scipy and c++14.

Didn't do it. The 3.11 runtime helped. But Python's latency with #scikit-learn is still at-least twice as high on #FreeBSD as it is on #Debian. The reasons for this are not immediately clear to me. This doesn't bode well for my argument that BSD is a good alternative to Linux for data science workflows. 😅. I guess because I've always used Bhyve + Docker + Debian for DS, I never noticed the speed issues before. I'll send a note to the FreeBSD Python mailing list. Maybe they'll know.
@kta Python 3.10 and above got large performance improvements. Maybe here is the reason? FreeBSD 14.1 on the current branch uses 3.11 version of Python. And the difference in performance is visible. 😉
@thindil Thanks, that makes sense. I'll run it through the crank on 15.0 next and see if that does it.

@kta In addition to the Python version, look into the configuration options for all the applicable ports. Defaults on FreeBSD tend to prefer stability and compatibility over performance, whereas Linux platforms often lean the other way. If you install binary packages, then you are implicitly choosing those defaults.

Performance decreasing with increasing number of processors is often indicative of threading limitations.

There may also be platform tuning options with a similar impact.

@AJCxZ0 Thanks. Scikit is the heaviest dependency for the portion of the application that is performing poorly on FreeBSD. I'll build it from ports to try and make sure any tunables applied by Debian are also applied to BSD.