This is an automated email from the ASF dual-hosted git repository.
curth pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow-adbc.git
The following commit(s) were added to refs/heads/main by this push:
new d18e84db9 feat(csharp/Benchmarks): Add .NET Framework 4.7.2 support
with TLS co… (#3682)
d18e84db9 is described below
commit d18e84db9d8898b87256a2cc451d135e41cf1ffe
Author: eric-wang-1990 <[email protected]>
AuthorDate: Tue Nov 4 15:39:13 2025 -0800
feat(csharp/Benchmarks): Add .NET Framework 4.7.2 support with TLS co…
(#3682)
This commit enhances the CloudFetch benchmark suite to support testing
on .NET Framework 4.7.2, which is the runtime used by Power BI. There
are some notable difference in .NET472 vs .NET8.0, one of them is
/K4os.Compression.LZ4 use the DefaultArrayPool in .NET472 which has a 1
MB upper limit for array size, where .NET8.0 use the SharedArrayPool
which almost have no size limit.
Changes:
- Add net472 target framework to Benchmarks.csproj
- Make Tests project reference conditional (net8.0 only, since Tests
doesn't support net472)
- Enable TLS 1.2/1.3 in CloudFetchBenchmarkRunner for .NET Framework
- Enable TLS 1.2/1.3 in benchmark GlobalSetup for spawned processes
These changes are necessary because .NET Framework 4.7.2 doesn't enable
modern TLS protocols by default, which are required for Databricks HTTPS
connections. This allows accurate performance testing on the Power BI
runtime environment (net472 with DefaultArrayPool).
Command:
` dotnet run -c Release --project Benchmarks/Benchmarks.csproj
--framework net472 CloudFetchBenchmarkRunner`
Sample output:
| Method | ReadDelayMs | Mean | Min | Max | Median | Peak Memory (MB) |
Total Rows | Total Batches | Gen0 | Gen1 | Gen2 | Allocated |
|------------------ |------------
|--------:|--------:|--------:|--------:|-----------------:|-----------:|--------------:|------------:|-----------:|-----------:|----------:|
| ExecuteLargeQuery | 5 | 9.659 s | 9.016 s | 10.03 s | 9.928 s | 356.38
| 1,439,935 | 740 | 336000.0000 | 57000.0000 | 35000.0000 | 2.73 GB |
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude <[email protected]>
---
csharp/Benchmarks/Benchmarks.csproj | 3 ++-
csharp/Benchmarks/CloudFetchBenchmarkRunner.cs | 7 +++++++
csharp/Benchmarks/Databricks/CloudFetchRealE2EBenchmark.cs | 7 +++++++
3 files changed, 16 insertions(+), 1 deletion(-)
diff --git a/csharp/Benchmarks/Benchmarks.csproj
b/csharp/Benchmarks/Benchmarks.csproj
index 9a5b7d931..77db6bb99 100644
--- a/csharp/Benchmarks/Benchmarks.csproj
+++ b/csharp/Benchmarks/Benchmarks.csproj
@@ -2,7 +2,8 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
- <TargetFrameworks>net8.0</TargetFrameworks>
+ <TargetFrameworks
Condition="'$(IsWindows)'=='true'">net8.0;net472</TargetFrameworks>
+ <TargetFrameworks
Condition="'$(TargetFrameworks)'==''">net8.0</TargetFrameworks>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<ProcessArchitecture>$([System.Runtime.InteropServices.RuntimeInformation]::ProcessArchitecture.ToString().ToLowerInvariant())</ProcessArchitecture>
diff --git a/csharp/Benchmarks/CloudFetchBenchmarkRunner.cs
b/csharp/Benchmarks/CloudFetchBenchmarkRunner.cs
index 13c7ad515..e423fe117 100644
--- a/csharp/Benchmarks/CloudFetchBenchmarkRunner.cs
+++ b/csharp/Benchmarks/CloudFetchBenchmarkRunner.cs
@@ -19,6 +19,9 @@ using Apache.Arrow.Adbc.Benchmarks.Databricks;
using BenchmarkDotNet.Columns;
using BenchmarkDotNet.Configs;
using BenchmarkDotNet.Running;
+#if NET472
+using System.Net;
+#endif
namespace Apache.Arrow.Adbc.Benchmarks
{
@@ -30,6 +33,10 @@ namespace Apache.Arrow.Adbc.Benchmarks
{
public static void Main(string[] args)
{
+#if NET472
+ // Enable TLS 1.2/1.3 for .NET Framework 4.7.2 (required for
modern HTTPS endpoints)
+ ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12
| SecurityProtocolType.Tls11 | (SecurityProtocolType)3072; // 3072 = Tls13
+#endif
// Configure to include the peak memory column and hide confusing
error column
var config = DefaultConfig.Instance
.AddColumn(new PeakMemoryColumn())
diff --git a/csharp/Benchmarks/Databricks/CloudFetchRealE2EBenchmark.cs
b/csharp/Benchmarks/Databricks/CloudFetchRealE2EBenchmark.cs
index 5838442b8..c0ea7fe0e 100644
--- a/csharp/Benchmarks/Databricks/CloudFetchRealE2EBenchmark.cs
+++ b/csharp/Benchmarks/Databricks/CloudFetchRealE2EBenchmark.cs
@@ -29,6 +29,9 @@ using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Columns;
using BenchmarkDotNet.Reports;
using BenchmarkDotNet.Running;
+#if NET472
+using System.Net;
+#endif
namespace Apache.Arrow.Adbc.Benchmarks.Databricks
{
@@ -127,6 +130,10 @@ namespace Apache.Arrow.Adbc.Benchmarks.Databricks
[GlobalSetup]
public void GlobalSetup()
{
+#if NET472
+ // Enable TLS 1.2/1.3 for .NET Framework 4.7.2 (required for
modern HTTPS endpoints)
+ ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12
| SecurityProtocolType.Tls11 | (SecurityProtocolType)3072; // 3072 = Tls13
+#endif
// Check if Databricks config is available
string? configFile =
Environment.GetEnvironmentVariable("DATABRICKS_TEST_CONFIG_FILE");
if (string.IsNullOrEmpty(configFile))