4 ms·
These days it's "rewrite in Rust". Typically Python is just the entry and exit point (with a little bit of massaging), right? And then the overwhelming majori
by didip 1y ago
These days it's "rewrite in Rust".
Typically Python is just the entry and exit point (with a little bit of massaging), right?
And then the overwhelming majority of the business logic is done in Rust/C++/Fortran, no?
- 01HNNWZ0MV43FF 1y agoWith computer vision you end up wanting to read and write to huge buffers that aren't practical to serialize and are difficult to share. And even allocating and freeing multi-megabyte framebuffers at 60 FPS can put a little strain on the allocator, so you want to reuse them, which means you have to think about memory safety. That is probably why his demo was Sobel edge detection with Numpy. Sobel can run fast enough at standard resolution on a CPU, but once that huge buffer needs to be read or written outside of your fast language, things will get tricky. This also comes up in Tauri, since you have to bridge between Rust and JS. I'm not sure if Electron apps have the same problem or not.
- aeroevan 1y agoIn the data science/engineering world apache arrow is the bridge between languages, so you don't actually need to serialize into language specific structures which is really nice
- jononor 1y agoThe "numpy" Sobel code is not that good, unfortunately - all the iteration is done in Python, so there is not much benefit from involving numpy. If one would use say scipy.convolve2d on a numpy.array, it would be much faster.