Skip to content

Commit e862584

Browse files
author
richelbilderbeek
committed
Update Optimization lesson
1 parent 25c822f commit e862584

File tree

1 file changed

+25
-24
lines changed

1 file changed

+25
-24
lines changed

optimisation/optimisation_lecture/optimisation_lecture.qmd

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -27,19 +27,19 @@ Ideally, do something boring @newport2016deep!
2727

2828
## Schedule
2929

30-
| From | To | What |
31-
|-------|-------|------------|
32-
| 12:00 | 13:00 | Lunch |
33-
| 13:00 | 13:45 | Discuss Retrospect, misconceptions |
34-
| 13:45 | 14:00 | Break |
35-
| 14:00 | 14:45 | . |
36-
| 14:45 | 15:00 | Break |
37-
| 15:00 | 15:30 | . |
38-
| 15:30 | 16:00 | Reflection |
30+
| From | To | What |
31+
|-------|-------|---------------------------------------------------------|
32+
| 12:00 | 13:00 | Lunch |
33+
| 13:00 | 13:45 | Discuss Retrospect, misconceptions, get a speed profile |
34+
| 13:45 | 14:00 | Break |
35+
| 14:00 | 14:45 | Get a speed profile, ?case study |
36+
| 14:45 | 15:00 | Break |
37+
| 15:00 | 15:30 | Course recap, Open discussion |
38+
| 15:30 | 16:00 | Reflection |
3939

4040
# Retrospect
4141

42-
* [ ] Discuss
42+
- [ ] Discuss
4343

4444
# Optimisation
4545

@@ -230,7 +230,7 @@ Big-O helps to:
230230

231231
Agree yes/no
232232

233-
## Exercise 1 [SKIP]
233+
## Exercise 1 \[SKIP\]
234234

235235
- Measure big-O complexity of https://www.pythonpool.com/check-if-number-is-prime-in-python/
236236

@@ -269,7 +269,7 @@ def isprime(num):
269269
:::
270270
:::
271271

272-
## Exercise 1 [SKIP]
272+
## Exercise 1 \[SKIP\]
273273

274274
- Measure big-O complexity of https://www.pythonpool.com/check-if-number-is-prime-in-python/
275275

@@ -306,7 +306,7 @@ def Prime(no, i = 2):
306306
:::
307307
:::
308308

309-
## Exercise 2 [SKIP]
309+
## Exercise 2 \[SKIP\]
310310

311311
- Measure big-O complexity of DNA alignment at https://johnlekberg.com/blog/2020-10-25-seq-align.html
312312

@@ -329,10 +329,10 @@ ACGTACGTACGT-CGTACGTACGT
329329

330330
## Run-time speed profile: code
331331

332-
* [ ] Show R code in repo
333-
* [ ] Run R code from RStudio
334-
* [ ] Show Python code in repo
335-
* [ ] Run Python code from command line
332+
- [ ] Show R code in repo
333+
- [ ] Run R code from RStudio
334+
- [ ] Show Python code in repo
335+
- [ ] Run Python code from command line
336336

337337
## Myth 1
338338

@@ -357,17 +357,17 @@ def superfast_xor_swap(x, y):
357357
- [C++ Core Guidelines: Per.4: Don't assume that complicated code is necessarily faster than simple code](https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#per4-dont-assume-that-complicated-code-is-necessarily-faster-than-simple-code)
358358
- [C++ Core Guidelines: Per.5: Don't assume that low-level code is necessarily faster than high-level code](https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#per5-dont-assume-that-low-level-code-is-necessarily-faster-than-high-level-code)
359359

360-
## Exercise 1 [30 mins]
360+
## Exercise 1 \[30 mins\]
361361

362362
Create speed profile of any function you like.
363363

364-
* [ ] Remind Python and R code on learner's repo
364+
- [ ] Remind Python and R code on learner's repo
365365

366-
## Exercise 2 [SKIP]
366+
## Exercise 2 \[SKIP\]
367367

368368
Create speed profile of https://www.pythonpool.com/check-if-number-is-prime-in-python/
369369

370-
## Exercise 3 [SKIP]
370+
## Exercise 3 \[SKIP\]
371371

372372
Create speed profile of DNA alignment
373373

@@ -409,16 +409,17 @@ Adapt the constant to reality.
409409
410410
## Case study
411411

412-
* [ ] Show ProjectRampal
413-
* [ ] Maybe Marcus has a case study :-)
412+
- [ ] Show ProjectRampal
414413

415-
## Recap
414+
## Discussion
416415

417416
- Be critical on speed optimization solutions
418417
- Tested and clean code always comes first
419418
- Measure correctly, at the right complexity, before and after
420419
- Prefer changing big-O over micro-optimizations (but see first point!)
421420

421+
Agree yes/no?
422+
422423
## The End
423424

424425
## Links

0 commit comments

Comments
 (0)