Skip to content

Conversation

@laborg
Copy link
Contributor

@laborg laborg commented Dec 11, 2025

The refactored method is quite buggy. I assume that its not used that often, otherwise those bugs would have surfaced by now. Nevertheless this should be an improvment in terms of performance and correctness.

Improved performance

const ts = [DateTime("2017", "yyyy"), DateTime("2018", "yyyy"), DateTime("2019", "yyyy")]
@btime oldshowoff($ts)
@btime showoff($ts)

 7.991 μs (112 allocations: 5.38 KiB) # master
 5.386 μs (64 allocations: 2.59 KiB) # pr

Changed (IMHO corrected/intended) behaviour:

Milliseconds are now shown, if they are provided

x = DateTime.(["2017-04-01T12:00:00","2017-04-01T12:00:00.001","2017-04-01T12:00:00.123"]);

"Apr 1, 2017 12:00 |  12:00 |  12:00" # master
"Apr 1, 2017 12:00:00.000 | 12:00:00.001 | 12:00:00.123" # pr

Milliseconds are now hidden, if there aren't any

x = DateTime.(["2017-04-01T12:00:00","2017-04-01T12:00:01","2017-04-01T12:01:00"]);

"Apr 1, 2017 12:00:00.000 |  12:00:01.000 |  12:01:00.000" # master
"Apr 1, 2017 12:00:00 | 12:00:01 | 12:01:00" # pr

Seconds are now hidden, if there aren't any

x = DateTime.(["2017-04-01T00:00:00","2017-04-01T01:00:00","2017-04-01T12:34:00"]);

"Apr 1, 2017 00:00:00.000 |  01:00:00.000 |  12:34:00.000" # master
"Apr 1, 2017 00:00 | 01:00 | 12:34" # pr

Day is hidden, if all days are the first day of month

x = DateTime.(["2017-04-01T00:00:00","2017-05-01T00:00:00","2017-06-01T00:00:00"]);

"Apr 1, 2017 | May | Jun" # master
"Apr 2017 | May | Jun" # pr

@codecov
Copy link

codecov bot commented Dec 11, 2025

Codecov Report

❌ Patch coverage is 31.81818% with 30 lines in your changes missing coverage. Please review.
✅ Project coverage is 80.79%. Comparing base (e510033) to head (483d8ed).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
src/Showoff.jl 31.81% 30 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master      #48      +/-   ##
==========================================
- Coverage   84.65%   80.79%   -3.87%     
==========================================
  Files           2        2              
  Lines         189      177      -12     
==========================================
- Hits          160      143      -17     
- Misses         29       34       +5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

2 participants