-
-
Notifications
You must be signed in to change notification settings - Fork 11
Add motivation section including green computing info #30
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -20,6 +20,26 @@ This is an all-day course, however it normally finishes by early afternoon. | |||||
| <!-- TODO: course duration? --> | ||||||
| <!-- TODO: confident code syllabus? --> | ||||||
|
|
||||||
| ## Motivation | ||||||
|
|
||||||
| Why might you want to profile and optimise your code? | ||||||
|
|
||||||
| The simplest answer is that optimisation let you get results faster. It may also allow you to scale up your code to perform larger analyses that would otherwise have taken too long to be practical. | ||||||
|
|
||||||
| Making your code faster can have additional benefits: faster software uses less compute power. If you use paid-for compute resources, such as cloud computing or some HPC facilities, optimising your code can therefore reduce your costs. | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Trying to merge in the bit I had to strip out above.
Suggested change
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don’t think that works with the following sentence—enabling larger analyses (implicitly: using the same resources) will not “reduce your costs”, it will just get more results at the same cost.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. true, "reduce your cost per unit of work", but that sounds shit. |
||||||
|
|
||||||
| Using less computing power also helps make your software more environmentally sustainable. As funders and research institutions set Net Zero goals, and computationally-intensive research expands, sustainability is increasingly becoming a concern for researchers. | ||||||
|
|
||||||
| ::::::::::::::::::::::::::::::::::::: callout | ||||||
|
|
||||||
| ### Green computing | ||||||
|
|
||||||
| To find out more about sustainable computing, visit the [Green DiSC](https://www.software.ac.uk/GreenDiSC) website or see this [online training](https://learn.greensoftware.foundation/) from the Green Software Foundation. | ||||||
|
|
||||||
| ::::::::::::::::::::::::::::::::::::: | ||||||
|
|
||||||
| However, it's sensible to focus your optimisation efforts on the parts of the code that take the longest. This is where profiling comes in: by profiling your code, you can identify which parts contribute the most to its runtime, and target these for optimisation. | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Feel free to ignore if this is something where different style guides disagree, but I was taught to use sentence case after a colon if a complete sentence follows.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've never come across that capitalization rule before! I looked it up and it does seem to be something where different style guides recommend differently, so I'll leave it as-is. |
||||||
| Even if you don’t find any major performance gains, profiling can give you a better understanding of what your code is doing, or give you confidence that the performance of your code matches your expectations. | ||||||
|
|
||||||
| ## Learning Objectives | ||||||
| <!-- Aim for 3-4 objectives for every 6 hours of training --> | ||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rough tweak, putting a bit more emphasis on confidence in code quality (e.g. there's still a benefit even if profiling looks reasonable)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm … this is probably dependent on the target audience? I think for experienced software engineers, profiling becomes more about confirming that the performance matches expectations; but software performance is notoriously unintuitive—and especially so in a high-level language like Python, where you’d need to understand an additional layer of language implementation details to develop a decent intuition.
For the target audience of this course, I’d expect that most of them don’t have a well-developed intuition (yet—that’s part of what we try to develop in the optimisation section, after all!) … so I don’t think opening with this as the main motivation is a good fit.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's fair, however I'd contend that many of the most obvious performance issues in novice code flagged by a profiler require no expertise to identify beyond being the author of the code.
E.g. an old crude validation method, file IO or merely anything that isn't the "computational" bit of an algorithm.
However, I have definitely seen cases where it's not immediately obvious to the "novice", e.g. bespoke C++ vector class, nothing is inlined, their response was "well that's the maths, of-course it's expensive (or something to that effect).
Your position definitely applies to the more nuanced stuff, such as using NumPy and data-structures correctly though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we want to include this, I’d probably leave Liz’ writing unmodified and rather add a separate paragraph at the end—maybe framing it like “Even if you don’t find any major performance gains, this will be useful because … [confidence, better understanding, …]”