You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2020/12/19 12:48:43 UTC

[GitHub] [arrow] jorgecarleitao edited a comment on pull request #8796: [Rust] [Experiment] Vec vs current allocations

jorgecarleitao edited a comment on pull request #8796:
URL: https://github.com/apache/arrow/pull/8796#issuecomment-748470192


   I have now rebased this against master. After @jhorstmann fix to the out of bounds on #8954, it now runs correctly.
   
   Here are the results:
   
   # no SIMD
   
   ```
   git checkout master
   cargo bench --benches
   git checkout buffer2
   cargo bench --benches
   ```
   
   |  benchmark | variation (%) |
   |-------------- | -------------- | 
   | max 512 | 1030.1 | 
   | sum 512 | 972.0 | 
   | min 512 | 928.2 | 
   | max nulls 512 | 298.8 | 
   | min nulls 512 | 284.1 | 
   | gt_eq Float32 | 207.0 | 
   | sum nulls 512 | 201.6 | 
   | eq Float32 | 195.5 | 
   | lt_eq Float32 | 188.5 | 
   | neq scalar Float32 | 163.3 | 
   | divide_nulls_512 | 131.9 | 
   | divide 512 | 130.4 | 
   | lt_eq scalar Float32 | 128.3 | 
   | add 512 | 118.9 | 
   | add_nulls_512 | 115.7 | 
   | record_batches_to_csv | 112.5 | 
   | lt Float32 | 112.2 | 
   | subtract 512 | 107.8 | 
   | neq Float32 | 106.8 | 
   | gt Float32 | 106.4 | 
   | multiply 512 | 105.0 | 
   | eq scalar Float32 | 100.6 | 
   | gt_eq scalar Float32 | 80.8 | 
   | lt scalar Float32 | 66.5 | 
   | cast date64 to date32 512 | 63.2 | 
   | buffer_bit_ops and | 59.8 | 
   | buffer_bit_ops or | 58.2 | 
   | cast int32 to float64 512 | 52.4 | 
   | cast float64 to float32 512 | 43.0 | 
   | cast time64ns to time32s 512 | 42.9 | 
   | cast time32s to time32ms 512 | 41.0 | 
   | filter context f32 very low selectivity | 40.5 | 
   | cast date32 to date64 512 | 37.0 | 
   | gt scalar Float32 | 35.9 | 
   | cast int32 to float32 512 | 35.5 | 
   | struct_array_from_vec 1024 | 32.6 | 
   | lt scalar Float32 | 32.4 | 
   | concat str 1024 | 31.6 | 
   | cast int32 to int64 512 | 29.8 | 
   | cast float64 to uint64 512 | 27.7 | 
   | filter context u8 very low selectivity | 26.8 | 
   | take str 1024 | 26.6 | 
   | concat str nulls 1024 | 26.3 | 
   | take str null indices 1024 | 25.2 | 
   | take str null values 1024 | 25.1 | 
   | struct_array_from_vec 512 | 24.8 | 
   | cast timestamp_ms to timestamp_ns 512 | 20.8 | 
   | cast float32 to int32 512 | 20.3 | 
   | filter u8 very low selectivity | 19.7 | 
   | take str null indices 512 | 19.2 | 
   | take str 512 | 18.7 | 
   | cast time32s to time64us 512 | 17.3 | 
   | nlike_utf8 scalar equals | 16.1 | 
   | take bool 1024 | 15.8 | 
   | struct_array_from_vec 256 | 15.7 | 
   | array_from_vec 128 | 13.6 | 
   | nlike_utf8 scalar ends with | 13.4 | 
   | take i32 nulls 512 | 13.0 | 
   | equal_string_512 | 12.1 | 
   | take i32 512 | 11.7 | 
   | take i32 nulls 1024 | 11.1 | 
   | take str null values null indices 1024 | 10.3 | 
   | take i32 1024 | 10.2 | 
   | filter context u8 low selectivity | 10.0 | 
   | cast int32 to uint32 512 | 9.7 | 
   | filter u8 low selectivity | 9.4 | 
   | array_from_vec 256 | 8.8 | 
   | array_from_vec 512 | 8.0 | 
   | filter context u8 w NULLs high selectivity | 7.9 | 
   | filter u8 high selectivity | 7.9 | 
   | length | 7.5 | 
   | filter context u8 w NULLs low selectivity | 7.4 | 
   | min string 512 | 6.9 | 
   | equal_nulls_512 | 6.7 | 
   | filter context u8 high selectivity | 6.6 | 
   | like_utf8 scalar equals | 6.5 | 
   | array_string_from_vec 128 | 6.5 | 
   | like_utf8 scalar complex | 6.0 | 
   | filter context f32 high selectivity | 5.6 | 
   | min nulls 512 | 5.3 | 
   | like_utf8 scalar starts with | 5.2 | 
   | like_utf8 scalar contains | 5.1 | 
   | divide 512 | 4.8 | 
   | nlike_utf8 scalar contains | 4.8 | 
   | take bool nulls 1024 | 4.6 | 
   | concat i32 1024 | 4.5 | 
   | divide_nulls_512 | 4.4 | 
   | struct_array_from_vec 128 | 4.2 | 
   | min nulls string 512 | 4.2 | 
   | array_string_from_vec 256 | 3.4 | 
   | equal_string_nulls_512 | 2.7 | 
   | and | 2.6 | 
   | or | 2.4 | 
   | filter context u8 w NULLs very low selectivity | 2.3 | 
   | take bool nulls 512 | 2.2 | 
   | equal_512 | 2.0 | 
   | filter context f32 low selectivity | 1.8 | 
   | cast int64 to int32 512 | 1.5 | 
   | sort 2^12 | 1.5 | 
   | take bool 512 | 1.4 | 
   | min nulls string 512 | 1.4 | 
   | limit 512, 512 | 1.4 | 
   | not | 1.2 | 
   | array_string_from_vec 512 | 1.1 | 
   | nlike_utf8 scalar complex | 0.9 | 
   | gt_eq scalar Float32 | 0.9 | 
   | eq scalar Float32 | 0.7 | 
   | cast int64 to int32 512 | 0.7 | 
   | cast int32 to int32 512 | 0.5 | 
   | cast int32 to int32 512 | 0.5 | 
   | array_string_from_vec 512 | 0.5 | 
   | sort 2^10 | 0.4 | 
   | cast timestamp_ns to timestamp_s 512 | 0.4 | 
   | neq scalar Float32 | 0.3 | 
   | cast timestamp_ns to timestamp_s 512 | 0.2 | 
   | gt Float32 | -0.3 | 
   | min 512 | -0.3 | 
   | lt Float32 | -0.4 | 
   | sort nulls 2^12 | -0.4 | 
   | take bool nulls 512 | -0.6 | 
   | sort 2^12 | -0.6 | 
   | not | -0.8 | 
   | array_string_from_vec 256 | -0.9 | 
   | sort nulls 2^10 | -1.1 | 
   | equal_512 | -1.4 | 
   | array_slice 128 | -1.5 | 
   | nlike_utf8 scalar starts with | -1.5 | 
   | max nulls 512 | -1.7 | 
   | array_slice 512 | -1.7 | 
   | filter context u8 w NULLs very low selectivity | -1.8 | 
   | cast timestamp_ms to i64 512 | -1.8 | 
   | cast timestamp_ms to i64 512 | -1.9 | 
   | length | -2.0 | 
   | array_slice 512 | -2.0 | 
   | nlike_utf8 scalar complex | -2.1 | 
   | and | -2.3 | 
   | nlike_utf8 scalar contains | -2.5 | 
   | or | -2.6 | 
   | add 512 | -2.6 | 
   | struct_array_from_vec 128 | -2.7 | 
   | like_utf8 scalar starts with | -2.9 | 
   | concat i32 1024 | -3.3 | 
   | like_utf8 scalar contains | -3.4 | 
   | limit 512, 512 | -3.4 | 
   | multiply 512 | -3.5 | 
   | cast time32s to time32ms 512 | -3.6 | 
   | array_from_vec 512 | -3.7 | 
   | sort nulls 2^12 | -3.8 | 
   | subtract 512 | -3.9 | 
   | filter context f32 high selectivity | -4.0 | 
   | take bool nulls 1024 | -4.3 | 
   | add_nulls_512 | -4.9 | 
   | array_slice 2048 | -5.0 | 
   | like_utf8 scalar complex | -5.1 | 
   | cast timestamp_ms to timestamp_ns 512 | -5.2 | 
   | sum 512 | -5.3 | 
   | min string 512 | -5.5 | 
   | like_utf8 scalar ends with | -6.1 | 
   | array_string_from_vec 128 | -6.2 | 
   | concat i32 nulls 1024 | -6.2 | 
   | take i32 1024 | -6.5 | 
   | cast time32s to time64us 512 | -6.6 | 
   | take i32 nulls 1024 | -7.1 | 
   | take i32 nulls 512 | -7.2 | 
   | like_utf8 scalar ends with | -7.6 | 
   | like_utf8 scalar equals | -7.7 | 
   | filter context f32 low selectivity | -8.2 | 
   | nlike_utf8 scalar starts with | -8.6 | 
   | take str null values null indices 1024 | -8.7 | 
   | buffer_bit_ops or | -9.0 | 
   | equal_string_nulls_512 | -9.2 | 
   | array_from_vec 256 | -9.3 | 
   | cast int32 to uint32 512 | -9.3 | 
   | nlike_utf8 scalar ends with | -9.8 | 
   | take i32 512 | -9.9 | 
   | filter context u8 w NULLs low selectivity | -10.4 | 
   | array_from_vec 128 | -10.5 | 
   | equal_string_512 | -12.1 | 
   | filter context u8 high selectivity | -12.2 | 
   | struct_array_from_vec 256 | -12.7 | 
   | filter u8 high selectivity | -12.8 | 
   | buffer_bit_ops and | -13.0 | 
   | take bool 1024 | -13.3 | 
   | filter context u8 w NULLs high selectivity | -13.3 | 
   | take str null indices 512 | -14.4 | 
   | take str 512 | -14.5 | 
   | sum nulls 512 | -14.6 | 
   | filter u8 very low selectivity | -15.9 | 
   | concat str nulls 1024 | -18.0 | 
   | take str null values 1024 | -18.9 | 
   | take str null indices 1024 | -18.9 | 
   | cast float32 to int32 512 | -19.0 | 
   | take str 1024 | -19.7 | 
   | struct_array_from_vec 512 | -19.8 | 
   | cast int32 to int64 512 | -20.6 | 
   | filter context u8 very low selectivity | -21.1 | 
   | cast float64 to uint64 512 | -21.1 | 
   | cast int32 to float32 512 | -24.2 | 
   | struct_array_from_vec 1024 | -24.3 | 
   | nlike_utf8 scalar equals | -24.9 | 
   | filter u8 low selectivity | -26.1 | 
   | filter context u8 low selectivity | -26.3 | 
   | concat str 1024 | -27.6 | 
   | cast float64 to float32 512 | -27.6 | 
   | cast date32 to date64 512 | -28.1 | 
   | cast time64ns to time32s 512 | -29.5 | 
   | filter context f32 very low selectivity | -30.1 | 
   | cast int32 to float64 512 | -33.4 | 
   | cast date64 to date32 512 | -37.9 |
   
   # SIMD
   
   ```
   git checkout master
   cargo bench --benches --features simd
   git checkout buffer2
   cargo bench --benches --features simd
   ```
   
   |  benchmark | variation (%) |
   |-------------- | -------------- | 
   | like_utf8 scalar equals | 78.2 | 
   | cast date64 to date32 512 | 64.0 | 
   | cast date32 to date64 512 | 49.5 | 
   | cast float64 to float32 512 | 46.1 | 
   | nlike_utf8 scalar starts with | 44.7 | 
   | cast time64ns to time32s 512 | 44.2 | 
   | filter context f32 very low selectivity | 43.9 | 
   | lt scalar Float32 | 39.1 | 
   | lt_eq Float32 | 38.7 | 
   | like_utf8 scalar starts with | 38.4 | 
   | cast int32 to int64 512 | 35.7 | 
   | struct_array_from_vec 1024 | 35.4 | 
   | lt_eq scalar Float32 | 35.4 | 
   | eq scalar Float32 | 34.2 | 
   | neq Float32 | 32.1 | 
   | cast int32 to float64 512 | 31.6 | 
   | concat str 1024 | 31.4 | 
   | gt Float32 | 30.3 | 
   | neq scalar Float32 | 29.8 | 
   | like_utf8 scalar ends with | 29.0 | 
   | filter context u8 very low selectivity | 28.2 | 
   | equal_nulls_512 | 27.3 | 
   | eq Float32 | 27.1 | 
   | struct_array_from_vec 512 | 26.1 | 
   | cast float64 to uint64 512 | 25.9 | 
   | nlike_utf8 scalar ends with | 25.4 | 
   | lt Float32 | 24.8 | 
   | filter context u8 low selectivity | 24.5 | 
   | filter u8 low selectivity | 24.2 | 
   | gt_eq Float32 | 23.6 | 
   | cast time32s to time64us 512 | 23.6 | 
   | nlike_utf8 scalar equals | 23.2 | 
   | cast float32 to int32 512 | 22.5 | 
   | multiply 512 | 21.2 | 
   | buffer_bit_ops and | 20.3 | 
   | gt_eq scalar Float32 | 20.1 | 
   | take str 1024 | 19.5 | 
   | subtract 512 | 19.5 | 
   | cast int32 to float32 512 | 19.0 | 
   | take str null indices 1024 | 19.0 | 
   | take str null values 1024 | 17.4 | 
   | and | 17.4 | 
   | struct_array_from_vec 256 | 16.8 | 
   | or | 16.1 | 
   | not | 15.8 | 
   | take str 512 | 15.1 | 
   | cast int32 to uint32 512 | 14.8 | 
   | add_nulls_512 | 14.2 | 
   | add 512 | 14.0 | 
   | take str null indices 512 | 13.6 | 
   | filter u8 very low selectivity | 12.9 | 
   | filter context u8 w NULLs high selectivity | 12.5 | 
   | gt scalar Float32 | 12.5 | 
   | take i32 512 | 12.5 | 
   | filter context u8 w NULLs low selectivity | 12.4 | 
   | array_from_vec 128 | 10.6 | 
   | concat i32 nulls 1024 | 10.5 | 
   | concat str nulls 1024 | 10.1 | 
   | min string 512 | 9.5 | 
   | equal_string_nulls_512 | 9.2 | 
   | array_from_vec 256 | 9.0 | 
   | take i32 1024 | 8.3 | 
   | filter u8 high selectivity | 8.0 | 
   | take i32 nulls 1024 | 8.0 | 
   | take bool 512 | 7.7 | 
   | array_slice 2048 | 7.6 | 
   | take i32 nulls 512 | 7.5 | 
   | take bool 1024 | 7.2 | 
   | divide_nulls_512 | 7.1 | 
   | take str null values null indices 1024 | 6.8 | 
   | like_utf8 scalar contains | 6.2 | 
   | nlike_utf8 scalar contains | 6.2 | 
   | cast time32s to time32ms 512 | 6.0 | 
   | length | 5.9 | 
   | divide 512 | 5.5 | 
   | array_from_vec 512 | 5.4 | 
   | filter context u8 w NULLs very low selectivity | 5.2 | 
   | filter context u8 high selectivity | 4.8 | 
   | array_string_from_vec 512 | 4.6 | 
   | min nulls string 512 | 4.6 | 
   | min 512 | 4.6 | 
   | buffer_bit_ops or | 4.6 | 
   | sort nulls 2^12 | 4.5 | 
   | array_slice 512 | 4.4 | 
   | concat i32 1024 | 4.0 | 
   | equal_string_512 | 3.5 | 
   | cast timestamp_ms to timestamp_ns 512 | 3.2 | 
   | struct_array_from_vec 128 | 2.8 | 
   | array_string_from_vec 256 | 2.7 | 
   | filter context f32 high selectivity | 2.6 | 
   | array_slice 128 | 2.5 | 
   | limit 512, 512 | 2.2 | 
   | nlike_utf8 scalar complex | 2.2 | 
   | filter context f32 low selectivity | 2.0 | 
   | cast timestamp_ms to i64 512 | 1.9 | 
   | cast int64 to int32 512 | 1.9 | 
   | sort 2^10 | 1.8 | 
   | like_utf8 scalar complex | 1.8 | 
   | equal_string_512 | 1.6 | 
   | sort nulls 2^10 | 1.6 | 
   | equal_512 | 1.2 | 
   | take bool nulls 512 | 1.1 | 
   | array_string_from_vec 128 | 1.1 | 
   | limit 512, 512 | 0.8 | 
   | max nulls 512 | 0.6 | 
   | sort 2^12 | 0.4 | 
   | sum nulls 512 | 0.4 | 
   | min nulls 512 | 0.3 | 
   | max 512 | 0.3 | 
   | cast timestamp_ns to timestamp_s 512 | -0.2 | 
   | sort 2^12 | -0.3 | 
   | cast int32 to int32 512 | -0.5 | 
   | sum nulls 512 | -0.6 | 
   | like_utf8 scalar complex | -0.6 | 
   | min nulls 512 | -0.9 | 
   | filter context f32 low selectivity | -1.0 | 
   | sort nulls 2^10 | -1.0 | 
   | equal_512 | -1.0 | 
   | array_slice 2048 | -1.1 | 
   | nlike_utf8 scalar complex | -1.1 | 
   | array_string_from_vec 128 | -1.4 | 
   | sort 2^10 | -1.4 | 
   | max nulls 512 | -1.8 | 
   | max 512 | -1.9 | 
   | filter context f32 high selectivity | -2.1 | 
   | take bool nulls 1024 | -2.2 | 
   | concat i32 nulls 1024 | -2.5 | 
   | cast int64 to int32 512 | -2.6 | 
   | take bool nulls 1024 | -2.9 | 
   | buffer_bit_ops or | -3.2 | 
   | array_slice 128 | -3.3 | 
   | array_string_from_vec 256 | -3.7 | 
   | take bool 512 | -4.0 | 
   | array_slice 512 | -4.4 | 
   | filter context u8 high selectivity | -4.5 | 
   | struct_array_from_vec 128 | -4.5 | 
   | filter context u8 w NULLs very low selectivity | -4.6 | 
   | concat i32 1024 | -4.7 | 
   | length | -5.1 | 
   | array_string_from_vec 512 | -5.1 | 
   | min nulls string 512 | -5.3 | 
   | cast time32s to time32ms 512 | -5.3 | 
   | nlike_utf8 scalar contains | -5.6 | 
   | take bool 1024 | -6.1 | 
   | filter u8 high selectivity | -6.2 | 
   | array_from_vec 256 | -6.3 | 
   | equal_string_nulls_512 | -6.7 | 
   | array_from_vec 512 | -7.0 | 
   | min string 512 | -7.0 | 
   | cast timestamp_ms to timestamp_ns 512 | -7.1 | 
   | like_utf8 scalar contains | -7.1 | 
   | take i32 1024 | -7.4 | 
   | take i32 nulls 1024 | -7.7 | 
   | take str null values null indices 1024 | -8.0 | 
   | filter context u8 w NULLs high selectivity | -8.2 | 
   | take i32 nulls 512 | -8.4 | 
   | take i32 512 | -9.1 | 
   | filter u8 very low selectivity | -9.2 | 
   | divide_nulls_512 | -9.2 | 
   | array_from_vec 128 | -9.3 | 
   | divide 512 | -9.4 | 
   | concat str nulls 1024 | -9.4 | 
   | filter context u8 w NULLs low selectivity | -10.7 | 
   | take str null indices 512 | -12.5 | 
   | add 512 | -14.0 | 
   | or | -14.1 | 
   | not | -14.4 | 
   | gt scalar Float32 | -14.6 | 
   | cast int32 to float32 512 | -14.6 | 
   | take str 512 | -14.6 | 
   | struct_array_from_vec 256 | -14.7 | 
   | buffer_bit_ops and | -14.8 | 
   | add_nulls_512 | -14.9 | 
   | and | -15.4 | 
   | take str null values 1024 | -15.5 | 
   | nlike_utf8 scalar starts with | -15.6 | 
   | subtract 512 | -16.0 | 
   | cast int32 to uint32 512 | -16.8 | 
   | gt_eq scalar Float32 | -17.0 | 
   | take str null indices 1024 | -17.3 | 
   | take str 1024 | -17.3 | 
   | cast float32 to int32 512 | -17.6 | 
   | filter context u8 very low selectivity | -18.3 | 
   | multiply 512 | -18.3 | 
   | nlike_utf8 scalar equals | -18.5 | 
   | filter u8 low selectivity | -19.3 | 
   | filter context u8 low selectivity | -19.3 | 
   | concat str 1024 | -19.6 | 
   | lt Float32 | -19.9 | 
   | nlike_utf8 scalar ends with | -20.1 | 
   | gt_eq Float32 | -20.1 | 
   | cast time32s to time64us 512 | -20.2 | 
   | struct_array_from_vec 512 | -20.3 | 
   | equal_nulls_512 | -20.6 | 
   | eq Float32 | -21.3 | 
   | cast float64 to uint64 512 | -21.5 | 
   | cast int32 to float64 512 | -22.5 | 
   | gt Float32 | -23.3 | 
   | like_utf8 scalar ends with | -23.5 | 
   | neq scalar Float32 | -23.5 | 
   | take bool nulls 512 | -23.8 | 
   | neq Float32 | -24.1 | 
   | lt_eq Float32 | -24.4 | 
   | lt_eq scalar Float32 | -25.9 | 
   | eq scalar Float32 | -26.3 | 
   | cast int32 to int64 512 | -26.4 | 
   | struct_array_from_vec 1024 | -27.6 | 
   | like_utf8 scalar starts with | -27.8 | 
   | lt scalar Float32 | -28.1 | 
   | filter context f32 very low selectivity | -30.4 | 
   | cast time64ns to time32s 512 | -30.6 | 
   | cast date32 to date64 512 | -32.2 | 
   | cast float64 to float32 512 | -33.2 | 
   | cast date64 to date32 512 | -39.4 | 
   | like_utf8 scalar equals | -43.8 | 
   | record_batches_to_csv | -52.9 |
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org