From c4c745e53ebfac6d87f492bf005578b2a36fa696 Mon Sep 17 00:00:00 2001 From: blaginin Date: Fri, 20 Mar 2026 19:50:33 +0000 Subject: [PATCH 1/2] cached `get_available_parallelism` --- datafusion/common/src/utils/mod.rs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/datafusion/common/src/utils/mod.rs b/datafusion/common/src/utils/mod.rs index 075a189c371dc..97525740027f4 100644 --- a/datafusion/common/src/utils/mod.rs +++ b/datafusion/common/src/utils/mod.rs @@ -40,7 +40,7 @@ use std::cmp::{Ordering, min}; use std::collections::HashSet; use std::num::NonZero; use std::ops::Range; -use std::sync::Arc; +use std::sync::{Arc, LazyLock}; use std::thread::available_parallelism; /// Applies an optional projection to a [`SchemaRef`], returning the @@ -923,10 +923,15 @@ pub fn combine_limit( /// /// This is a wrapper around `std::thread::available_parallelism`, providing a default value /// of `1` if the system's parallelism cannot be determined. +/// +/// The result is cached after the first call. pub fn get_available_parallelism() -> usize { - available_parallelism() - .unwrap_or(NonZero::new(1).expect("literal value `1` shouldn't be zero")) - .get() + static PARALLELISM: LazyLock = LazyLock::new(|| { + available_parallelism() + .unwrap_or(NonZero::new(1).expect("literal value `1` shouldn't be zero")) + .get() + }); + *PARALLELISM } /// Converts a collection of function arguments into a fixed-size array of length N From 34d3034148b9703457c3c88896c5d1afafbb023a Mon Sep 17 00:00:00 2001 From: blaginin Date: Fri, 20 Mar 2026 21:08:37 +0000 Subject: [PATCH 2/2] simplify extended --- .github/workflows/extended.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/extended.yml b/.github/workflows/extended.yml index c2aa96d92edc0..4a2198b22cf76 100644 --- a/.github/workflows/extended.yml +++ b/.github/workflows/extended.yml @@ -173,10 +173,9 @@ jobs: ref: ${{ github.event.inputs.pr_head_sha }} # will be empty if triggered by push submodules: true fetch-depth: 1 - - name: Setup Rust toolchain - uses: ./.github/actions/setup-builder - with: - rust-version: stable + - name: Install protobuf compiler + run: | + apt-get update && apt-get install -y protobuf-compiler - name: Run sqllogictest run: | cargo test --features backtrace,parquet_encryption --profile ci-optimized --test sqllogictests -- --include-sqlite \ No newline at end of file