My personal benchmark shows Rust interface is much slower than Python interface #2260
-
I'm writing 40 million 2-column rows to a dataset, they yield about 1.1GB size in total. I found that Rust is much slower than Python(2x time usage), which is a bit hard to understand. The code looks like below: Python:
Rust code looks like this:
Rust uses 20917ms and Python uses 9510ms. Are there anything I'm doing wrong with using the interfaces? Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @ScottLinnn. It might be informative to look at our compiler config for the Python binaries: lance/python/.cargo/config.toml Line 25 in fb43192 lance/python/.cargo/config.toml Line 2 in fb43192 We enable certain flags to get SIMD support built in. We also enable "thin" LTO. Both those can have significant impact. Also I'm not sure how impactful this would be for write, but in tokio, you want to make sure you've enabled the multi-threaded runtime. Line 45 in fb43192 |
Beta Was this translation helpful? Give feedback.
Hi @ScottLinnn. It might be informative to look at our compiler config for the Python binaries:
lance/python/.cargo/config.toml
Line 25 in fb43192
lance/python/.cargo/config.toml
Line 2 in fb43192
We enable certain flags to get SIMD support built in. We also enable "thin" LTO. Both those can have significant impact.
Also I'm not sure how impactful this would be for write, but in tokio, you want to make sure you've enabled the multi-threaded runtime.
lance/python/Cargo.toml
Line 45 in fb43192