Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use dates.jl for 10x+ benchmark for mdy, dmy, ymd and _hms versions #22

Merged
merged 5 commits into from
Feb 21, 2025

Conversation

drizk1
Copy link
Member

@drizk1 drizk1 commented Feb 17, 2025

improve initial parsing to better leverage Dates.jl and bring benchmarks nearly inline w dates.jl, without sacrificing flexibility for

  • mdy_hms, mdy
  • ymd_hms, ymd
  • dmy_hms, dmy

for ex

@benchmark @mutate(dates, test = Date(dt2, "dd-mm-yyyy"))
BenchmarkTools.Trial: 1398 samples with 1 evaluation per sample.
 Range (min … max):  2.927 ms … 258.430 ms  ┊ GC (min … max): 0.00% … 98.37%
 Time  (median):     3.219 ms               ┊ GC (median):    0.00%
 Time  (mean ± σ):   3.573 ms ±   6.860 ms  ┊ GC (mean ± σ):  8.23% ±  9.48%

   █▆▄▂                                                        
  █████▆▅█▅▆▃▂▂▂▂▂▂▂▂▂▂▁▂▁▁▂▁▂▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▂▂▂▂▂▂▂▂ ▃
  2.93 ms         Histogram: frequency by time         7.6 ms <

 Memory estimate: 1.42 MiB, allocs estimate: 25145.

@benchmark @mutate(dates, test = dmy(dt2))
BenchmarkTools.Trial: 1287 samples with 1 evaluation per sample.
 Range (min … max):  3.163 ms … 250.221 ms  ┊ GC (min … max): 0.00% … 98.13%
 Time  (median):     3.365 ms               ┊ GC (median):    0.00%
 Time  (mean ± σ):   3.882 ms ±   6.947 ms  ┊ GC (mean ± σ):  7.76% ±  9.09%

  ▅█▆▅▅▃▂▂▃▂▁                                                  
  ███████████▇▇▆▆▇▅▇▆▆▆▅▆▄▁▄▅▅▁▄▄▄▁▁▁▁▄▁▄▄▁▄▄▄▁▄▄▆▅▅▇▅▄▆▄▄▄▁▅ █
  3.16 ms      Histogram: log(frequency) by time      8.15 ms <

 Memory estimate: 1.44 MiB, allocs estimate: 26145.

@drizk1 drizk1 changed the title for mdy, dmy, ymd and hms versions 10x+ speed for mdy, dmy, ymd and hms versions Feb 17, 2025
@drizk1 drizk1 changed the title 10x+ speed for mdy, dmy, ymd and hms versions use dates.jl for 10x+ benchmark for mdy, dmy, ymd and _hms versions Feb 17, 2025
@drizk1 drizk1 merged commit 5f3bc82 into main Feb 21, 2025
3 checks passed
@drizk1 drizk1 deleted the 10xspeed branch February 21, 2025 02:04
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.

1 participant