improve timeit examples#39
Conversation
* vary number of repeats to ensure total runtime stays manageable * remove some ad hoc scaling factors * use total time instead of per-run time * format large numbers with _ for legibility
Thank you!Thank you for your pull request 😃 🤖 This automated message can help you check the rendered files in your submission for clarity. If you have any questions, please feel free to open an issue in {sandpaper}. If you have files that automatically render output (e.g. R Markdown), then you should check for the following:
Rendered Changes🔍 Inspect the changes: https://github.com/carpentries-incubator/pando-python/compare/md-outputs..md-outputs-PR-39 The following changes were observed in the rendered markdown documents: What does this mean?If you have source files that require output and figures to be generated (e.g. R Markdown), then it is important to make sure the generated figures and output are reproducible. This output provides a way for you to inspect the output in a diff-friendly manner so that it's easy to see the changes that occur due to new software versions or randomisation. ⏱️ Updated at 2026-02-24 21:15:14 +0000 |
Robadob
left a comment
There was a problem hiding this comment.
Seems ok.
Per-time is mostly useful to make clear that most of these things are tiny, so fine if you're doing it once or twice. But terrible if they're central to your code or you're pushing them to huge scales.
Auto-generated via `{sandpaper}`
Source : 6228149
Branch : md-outputs
Author : GitHub Actions <actions@github.com>
Time : 2026-02-25 00:09:37 +0000
Message : markdown source builds
Auto-generated via `{sandpaper}`
Source : 22a853e
Branch : main
Author : Jost Migenda <jost.migenda@kcl.ac.uk>
Time : 2026-02-25 00:07:48 +0000
Message : Merge pull request #39 from JostMigenda/timeit_examples
Auto-generated via `{sandpaper}`
Source : 6228149
Branch : md-outputs
Author : GitHub Actions <actions@github.com>
Time : 2026-02-25 00:09:37 +0000
Message : markdown source builds
Auto-generated via `{sandpaper}`
Source : 22a853e
Branch : main
Author : Jost Migenda <jost.migenda@kcl.ac.uk>
Time : 2026-02-25 00:07:48 +0000
Message : Merge pull request #39 from JostMigenda/timeit_examples
Auto-generated via `{sandpaper}`
Source : 6228149
Branch : md-outputs
Author : GitHub Actions <actions@github.com>
Time : 2026-02-25 00:09:37 +0000
Message : markdown source builds
Auto-generated via `{sandpaper}`
Source : 22a853e
Branch : main
Author : Jost Migenda <jost.migenda@kcl.ac.uk>
Time : 2026-02-25 00:07:48 +0000
Message : Merge pull request #39 from JostMigenda/timeit_examples
Auto-generated via `{sandpaper}`
Source : 6228149
Branch : md-outputs
Author : GitHub Actions <actions@github.com>
Time : 2026-02-25 00:09:37 +0000
Message : markdown source builds
Auto-generated via `{sandpaper}`
Source : 22a853e
Branch : main
Author : Jost Migenda <jost.migenda@kcl.ac.uk>
Time : 2026-02-25 00:07:48 +0000
Message : Merge pull request #39 from JostMigenda/timeit_examples
Closes #16.
int()callsIn particular, I’m curious what you think about the third point.
I was initially hesitant to change this. But since these are all toy examples (and e.g. use arbitrary list lengths), I don’t think the time per repeat is particularly meaningful? Switching to the total time (of all repeats) lets us vary the number of repeats without having to worry about scaling factors; and overall, I think this simplicity wins the argument for me.