Skip to content

Conversation

@adriencaccia
Copy link
Member

  • feat: improve time unit display in local walltime
  • feat: do not store the profile when CODPSEED_PROFILE_FOLDER is not set

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR improves the local walltime display by implementing human-readable time unit formatting and prevents profile storage when the CODSPEED_PROFILE_FOLDER environment variable is not set.

Key Changes:

  • Added format_time() function to convert nanosecond timestamps into human-readable strings with appropriate units (ns, µs, ms, s)
  • Modified profile storage logic to skip saving results when CODSPEED_PROFILE_FOLDER is not configured
  • Removed unused time import from plugin.py

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
tests/test_format_time.py New test file covering various time formatting scenarios across all supported units
src/pytest_codspeed/plugin.py Updated to skip profile storage when profile_folder is None and removed unused import
src/pytest_codspeed/instruments/walltime.py Added format_time() function and integrated it into benchmark table display
Comments suppressed due to low confidence (1)

src/pytest_codspeed/instruments/walltime.py:1

  • Corrected comment on line 408 from 'Less than 1 millisecond' to 'Less than 1 second'.
from __future__ import annotations

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@codspeed-hq
Copy link

codspeed-hq bot commented Nov 12, 2025

CodSpeed Performance Report

Merging #97 will degrade performances by 16.4%

Comparing feat/improve-local-walltime (bb84077) with master (a71ec50)

Summary

⚡ 20 improvements
❌ 16 (👁 16) regressions
✅ 131 untouched

Benchmarks breakdown

Mode Benchmark BASE HEAD Change
👁 WallTime test_iir_filter_process 2.6 µs 2.7 µs -3.89%
👁 WallTime test_iir_filter_set_coefficients[a_coeffs0-b_coeffs0] 818.9 ns 837.2 ns -2.19%
👁 WallTime test_make_lowpass 5.4 µs 5.5 µs -2.07%
WallTime test_color[graph0-3] 27.2 µs 26.6 µs +2.27%
👁 WallTime test_combination_lists[4-2] 3.8 µs 4 µs -4.19%
WallTime test_depth_first_search[4] 32.6 µs 31.6 µs +3.06%
WallTime test_generate_all_combinations[5-4] 10.4 µs 9.9 µs +4.66%
WallTime test_generate_parenthesis[3] 11.8 µs 11.1 µs +6.93%
👁 WallTime test_generate_sum_of_subsets_soln[nums0-9] 22.2 µs 23.4 µs -5.23%
WallTime test_hamilton_cycle[graph0] 25.5 µs 23.3 µs +9.7%
WallTime test_match_word_pattern[aba-GraphTreesGraph] 96.9 µs 94.2 µs +2.87%
👁 WallTime test_minimax[scores0] 7.7 µs 8.1 µs -5.07%
👁 WallTime test_open_knight_tour[1] 3.9 µs 4 µs -2.61%
WallTime test_sum_squares_slow 328.4 µs 280.2 µs +17.18%
👁 WallTime test_iterative_fibo_10 1.3 µs 1.4 µs -4.41%
WallTime test_recursive_fibo_10 44.6 µs 42.7 µs +4.58%
WallTime test_count_even[count_even_slow] 1.3 ms 1.2 ms +7.34%
WallTime test_sum_of_squares[sum_of_squares_sum_comprehension_product] 199.2 µs 187.4 µs +6.3%
👁 WallTime test_sum_of_squares[sum_of_squares_sum_labmda_product] 246.2 µs 261.7 µs -5.95%
WallTime test_array_alloc[100] 1.1 µs 1 µs +3.11%
... ... ... ... ... ...

ℹ️ Only the first 20 benchmarks are displayed. Go to the app to view all benchmarks.

Copy link
Contributor

@GuillaumeLagrange GuillaumeLagrange left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@adriencaccia adriencaccia force-pushed the feat/improve-local-walltime branch from b4f92d8 to bb84077 Compare November 13, 2025 14:33
@adriencaccia adriencaccia merged commit bb84077 into master Nov 13, 2025
36 checks passed
@adriencaccia adriencaccia deleted the feat/improve-local-walltime branch November 13, 2025 14:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants