Benchmarks for AWS Advanced Python Driver

December 22, 2025 ยท View on GitHub

This directory contains a set of benchmarks for the AWS Advanced Python Driver. These benchmarks measure the overhead from executing Python method calls with multiple connection plugins enabled. The benchmarks do not measure the performance of target Python drivers nor the performance of the failover process.

Usage

  1. Install pytest-benchmark with the following command pip install pytest-benchmark.
  2. Run the benchmarks with the following command pytest <path to benchmark file>.
    1. You have to run the command separately for each benchmark file.

Benchmark Results

Tests ran on commit 3d473f6c12f495762d3b7436a97a0e6bd76361d7

Summary

BenchmarkOverhead
Execute query with execution time plugin vs without execution time plugin128%
Init and release read write splitting plugin with vs without internal connection pools103%
Init and release read write splitting plugin and aurora connection tracker plugin with vs without internal connection pools102%
Init plugin manager with vs without plugins271%
Init host provider with vs without plugins100%
Notify connection changed with vs without plugins106%
Execute with vs without plugins105%
Connect with vs without plugins100%

Raw Data

Name (microseconds)MinMaxMean
test_create_cursor_baseline103.4621863.92176.86
test_init_and_release_with_read_write_splitting_plugin117.6323399.29155.63
test_init_and_release_with_execution_time_plugin118.1311647.50153.55
test_init_and_release_with_aurora_connection_tracker_plugin118.1716153.21173.76
test_init_and_release_with_read_write_splitting_plugin_internal_connection_pools121.3823713.75175.25
test_init_and_release_with_execute_time_and_aurora_connection_tracker_plugin126.1720433.96175.94
test_init_and_release_with_aurora_connection_tracker_and_read_write_splitting_plugin127.7922220.75181.27
test_init_and_release_with_aurora_connection_tracker_and_read_write_splitting_plugin_internal_connection_pools130.7527415.50178.62
test_execute_query_with_execute_time_plugin132.7937440.38248.63
Name (nanoseconds)MinMaxMean
test_init_plugin_manager_with_no_plugins875347081040.50
test_init_plugin_manager_with_plugins2375739172550.91
test_release_resources_with_no_plugins4625675004889.21
test_init_host_provider_with_no_plugins499594431141761497.79
test_init_host_provider_with_plugins5020828091758635.75
test_release_resources_with_plugins5025063475052090.03
test_notify_connection_changed_with_no_plugins50542958812560554.89
test_notify_connection_changed_with_plugins53625980395863355.84
test_execute_with_no_plugins78375110642542163380.40
test_execute_with_plugins8245847187834142509.64
test_connect_with_no_plugins802750629661671316711.28
test_connect_with_plugins8054581577313341619050.00