.c[
> *Нормальность — это миф; никогда не было и никогда не будет ни одного нормального распределения.*
> ["Testing for normality"](http://webspace.ship.edu/pgmarr/Geo441/Readings/Geary%201947%20-%20Testing%20for%20Normality.pdf), R.C. Geary, 1947
]
---
class: normal
### Проведём эксперимент
.up[]
.size-75[
.center[
.superscript[1]Department of Psychology, University of California at Santa Barbara, Santa Barbara, CA 93106
.superscript[2]Department of Psychology, Blodgett Hall, Vassar College, Poughkeepsie, NY 12604
.superscript[3]Department of Psychological and Brain Sciences, Moore Hall, Dartmouth College, Hanover, NH03755
---
class: normal
### Функциональная МРТ мёртвого атлантического лосося
.up2[]
.center[]
.up1[]
.center[]
.bottom-hint-huge[Bennet, C., A. Baird, M. Miller, and G. Wolford. ["Neural correlates of interspecies perspective taking in the post-mortem Atlantic salmon: An argument for proper multiple comparisons correction."](https://teenspecies.github.io/pdfs/NeuralCorrelates.pdf)
Journal of Serendipitous and Unexpected Results 1, no. 1 (2010): 1-5.]
---
class: normal
### Нужно запомнить
.memorize[Статистические тесты
сложны для восприятия и использования ]
---
class: normal
count: false
### Нужно запомнить
.memorize[Статистические тесты
сложны для восприятия и использования;
обладают множеством скрытых ограничений ]
---
class: normal
count: false
### Нужно запомнить
.memorize[Статистические тесты
сложны для восприятия и использования;
обладают множеством скрытых ограничений;
не воспроизводимы ]
---
class: normal
count: false
### Нужно запомнить
.memorize[Статистические тесты
сложны для восприятия и использования;
обладают множеством скрытых ограничений;
не воспроизводимы;
отвечают не на тот вопрос ]
---
class: normal
count: false
### Нужно запомнить
.memorize[Статистические тесты
сложны для восприятия и использования;
обладают множеством скрытых ограничений;
не воспроизводимы;
отвечают не на тот вопрос;
...]
---
class: normal
### Нужно запомнить
.memorize[Статистические тесты
не нужны в перфоманс-анализе]
---
template: template-comics
.center[]
.comics[
Но если тесты на статистическую значимость не нужны,
то как распределения-то сравнивать?
]
---
template: template-section
## Часть 4
## Сравниваем перфомансные распределения
---
layout: true
template: template-page
.footer-note[(4) Сравниваем перфомансные распределения]
---
class: normal
### Ключевые слова для поиска
.up[]
.center[]
---
class: normal
### Сдвиг всего распределения
.up[]
.center[]
---
class: normal
### Сдвиг одной моды
.up[]
.center[]
---
class: normal
### Сдвиг двух мод
.up[]
.center[]
---
class: normal
### Функция сдвига
.up[]
.center[]
---
class: normal
count: false
### Функция сдвига
.up[]
.center[]
---
class: normal
count: false
### Функция сдвига
.up[]
.center[]
---
class: normal
count: false
### Функция сдвига
.up[]
.center[]
---
class: normal
count: false
### Функция сдвига
.up[]
.center[]
---
class: normal
count: false
### Функция сдвига
.up[]
.center[]
---
class: normal
count: false
### Функция сдвига
.up[]
.center[]
---
class: normal
### Функция сдвига
.up2[]
.center[]
---
class: normal
### Функция пропорции
.up[]
.center[]
---
class: normal
### Сдвиг средней моды
.up[]
.center[]
---
class: normal
### Статистическое безобразие
.up[]
.center-wide[
.pull-left[]
.pull-right[]
]
---
class: normal
### Метрики в текстовом виде
.size-150[
```md
| Метод | Пропорция |
|-------|-----------|
| A | Эталон |
| B | `1.5-3.0` |
| C | `1.2-1.4` |
| D | `1.2-1.3` |
```
]
--
```md
🐙Менеджер : У нас точно есть все эти деградации?
```
--
.up1[]
```md
🐵Перфоманс-инженер : (B,C) Скорее всего, данных довольно много.
```
--
.up1[]
```md
🐵Перфоманс-инженер : (D) Непонятно, надо бы собрать больше данных.
```
---
class: normal
### Статистика должна быть дружелюбной
.size-150[
```md
| Метод | Пропорция | Точно ли есть деградация? |
|-------|-----------|---------------------------|
| A | Эталон | |
| B | 1.5-3.0 | `Скорее всего` |
| C | 1.2-1.4 | `Скорее всего` |
| D | 1.2-1.3 | `🤷♀️ Нужно больше данных` |
```
]
---
class: normal
### Нужно запомнить
.memorize[Не "деградировали ли мы?",
а "насколько мы деградировали?"]
---
template: template-comics
.center[]
.comics[
А если у меня есть история замеров?
Как в ней проблемы искать?
]
---
template: template-section
## Часть 5
## Анализируем историю замеров
---
layout: true
template: template-page
.footer-note[(5) Анализируем историю замеров]
---
class: normal
### Изменения бывают разными
.up[]
.center[]
---
class: normal
count: false
### Изменения бывают разными
.up[]
.center[]
---
class: normal
count: false
### Изменения бывают разными
.up[]
.center[]
---
class: normal
count: false
### Изменения бывают разными
.up[]
.center[]
---
class: normal
count: false
### Изменения бывают разными
.up[]
.center[]
---
class: normal
count: false
### Изменения бывают разными
.up[]
.center[]
---
class: normal
count: false
### Изменения бывают разными
.up[]
.center[]
---
class: normal
count: false
### Изменения бывают разными
.up[]
.center[]
---
class: normal
### Много разных алгоритмов
.up[]
.center[]
.bottom-hint-huge[Truong, Charles, Laurent Oudre, and Nicolas Vayatis. ["Selective review of offline change point detection methods."](https://arxiv.org/pdf/1801.00718.pdf) Signal Processing 167 (2020): 107299.]
---
class: normal
### Хороший алгоритм: ED-PELT
.center[]
.bottom-hint-huge[Haynes, Kaylea, Paul Fearnhead, and Idris A. Eckley. ["A computationally efficient nonparametric approach for changepoint detection."](https://link.springer.com/article/10.1007/s11222-016-9687-5) Statistics and Computing 27, no. 5 (2017): 1293-1305.]
---
class: normal
### Динамическое программирование
--
.up[]
.center[]
---
class: normal
count: false
### Динамическое программирование
.up[]
.center[]
---
class: normal
count: false
### Динамическое программирование
.up[]
.center[]
---
class: normal
count: false
### Динамическое программирование
.up[]
.center[]
---
class: normal
count: false
### Динамическое программирование
.up[]
.center[]
---
class: normal
count: false
### Динамическое программирование
.up[]
.center[]
---
class: normal
count: false
### Динамическое программирование
.up[]
.center[]
---
class: normal
count: false
### Динамическое программирование
.up[]
.center[]
---
class: normal
count: false
### Динамическое программирование
.up[]
.center[]
---
class: normal
count: false
### Динамическое программирование
.up[]
.center[]
---
class: normal
### Pruned exact linear time (PELT)
.up[]
.center[]
.bottom-hint-huge[Killick, R., Fearnhead, P., Eckley, I.A. ["Optimal detection of changepoints with a linear computational cost."](https://arxiv.org/pdf/1101.1438.pdf)
J. Am. Stat. Assoc. 107(500), 1590–1598 (2012)]
---
class: normal
count: false
### Pruned exact linear time (PELT)
.up[]
.center[]
.bottom-hint-huge[Killick, R., Fearnhead, P., Eckley, I.A. ["Optimal detection of changepoints with a linear computational cost."](https://arxiv.org/pdf/1101.1438.pdf)
J. Am. Stat. Assoc. 107(500), 1590–1598 (2012)]
---
class: normal
### Функция стоимости на эмпирическом распределении
--
.center[
Вводим обозначения:]
$$
\{x_j\}_n - \textrm{данные}, \quad \{\tau_i\} - \textrm{индексы точек разладки}
$$
--
.center[
Задаём эмпирическую функцию распределения:]
$$
\hat{F}_i(t) {=}\frac{1}{\tau _i-\tau _{i-1}} \times \left( \sum _{j=\tau _{i-1}+1}^{\tau _i} \mathbf {1}\{x_j < t\} + 0.5 \times \mathbf {1}\{x_j {=} t\} \right)
$$
--
.center[
Задаём непараметрическую функцию максимального правдоподобия:]
\begin{aligned}&\mathcal {L}_{np}(x_{\tau _{i-1}+1:\tau _i}|t) = (\tau _{i} - \tau _{i-1})\times [\hat{F}_i(t) \log \hat{F}_i(t) \nonumber +\,(1-\hat{F}_i(t)) \log (1-\hat{F}_i(t))] \end{aligned}
---
class: normal
### Функция стоимости на эмпирическом распределении
.center[
Считаем K квантилей по всей выборке:]
$$
t_k = (1 + (2n - 1) \cdot e^{\frac{c}{K}(2k-1)})^{-1}, \quad c = -log(2n - 1)
$$
--
.center[
Назначаем штраф (модифицированный Байесовский информационный критерий):]
$$
\textit{penalty} = 3 \cdot log(n)
$$
--
.center[**
Определяем функцию стоимости:**]
$$
w(j, i) = \frac{-2c}{K} \sum_{k=1}^{K} \mathcal {L}_{np}(x_{\tau_j+1:\tau _i}|t_k) + \textit{penalty}
$$
---
class: normal
### Запускаем ED-PELT короткой истории
.up[]
.center[]
---
class: normal
### Запускаем ED-PELT на длинной истории
.up[]
.center[]
---
class: normal
### Функция стоимости на пересечениях
.up[]
.center[]
---
class: normal
count: false
### Функция стоимости на пересечениях
.up[]
.center[]
---
class: normal
count: false
### Функция стоимости на пересечениях
.up[]
.center[]
---
class: normal
count: false
### Функция стоимости на пересечениях
.up[]
.center[]
---
class: normal
count: false
### Функция стоимости на пересечениях
.up[]
.center[]
---
class: normal
count: false
### Функция стоимости на пересечениях
.up[]
.center[]
---
class: normal
### Функция стоимости на пересечениях
--
.overlap-table[
 |
|
|
|
]
---
class: normal
count: false
### Функция стоимости на пересечениях
.overlap-table[
]
---
class: normal
count: false
### Функция стоимости на пересечениях
.overlap-table[
]
---
class: normal
count: false
### Функция стоимости на пересечениях
.overlap-table[
]
---
class: normal
### Функция стоимости на пересечениях
.up[]
.center[]
---
class: normal
### Поиск квантилей на отрезке (RQQ)
.up[]
.center[]
.bottom-hint-huge[Gagie, Travis, Simon J. Puglisi, and Andrew Turpin. ["Range quantile queries: Another virtue of wavelet trees."](https://arxiv.org/pdf/0903.4726.pdf) In International Symposium on String Processing and Information Retrieval, pp. 1-6. Springer, Berlin, Heidelberg, 2009.]
---
class: normal
### Сбалансированное вейвлет-дерево
.up3[]
.size-75[
.center[
]
]
---
class: normal
count: false
### Сбалансированное вейвлет-дерево
.up3[]
.size-75[
.center[
]
]
---
class: normal
count: false
### Сбалансированное вейвлет-дерево
.up3[]
.size-75[
.center[
]
]
---
class: normal
count: false
### Сбалансированное вейвлет-дерево
.up3[]
.size-75[
.center[
]
]
---
class: normal
count: false
### Сбалансированное вейвлет-дерево
.up3[]
.size-75[
.center[
]
]
---
class: normal
count: false
### Сбалансированное вейвлет-дерево
.up3[]
.size-75[
.center[
]
]
---
class: normal
count: false
### Сбалансированное вейвлет-дерево
.up3[]
.size-75[
.center[
]
]
---
class: normal
count: false
### Сбалансированное вейвлет-дерево
.up3[]
.size-75[
.center[
]
]
---
class: normal
count: false
### Сбалансированное вейвлет-дерево
.up3[]
.size-75[
.center[
]
]
---
class: normal
count: false
### Сбалансированное вейвлет-дерево
.up3[]
.size-75[
.center[
]
]
---
class: normal
count: false
### Сбалансированное вейвлет-дерево
.up3[]
.size-75[
.center[
]
]
---
class: normal
count: false
### Сбалансированное вейвлет-дерево
.up3[]
.size-75[
.center[
]
]
---
class: normal
### Запускаем ED-PELT и RQQ-PELT
.up[]
.center[]
---
class: normal
### Как начать всё это использовать?
--
.center[**Фаза 1: Просто попробуйте**]
* R : https://cran.r-project.org/web/packages/changepoint.np/index.html
* Command-line, C#: https://perfolizer.com
--
.center[**Фаза 2: Анализируйте ограничения**]
--
* Сколько у вас тестов?
--
* Сколько у вас замеров для каждого теста?
--
* Какие изменения вы хотите находить?
--
* Сколько времени вы готовы тратить на поиск?
---
class: normal
### История про медленный NuGet-сервер
--
.up[]
.center[]
.bottom-hint-huge[Andrey Akinshin. "A story about slow NuGet package browsing." (2018)
https://aakinshin.net/posts/nuget-package-browsing/]
---
class: normal
count: false
### История про медленный NuGet-сервер
.up[]
.center[]
.bottom-hint-huge[Andrey Akinshin. "A story about slow NuGet package browsing." (2018)
https://aakinshin.net/posts/nuget-package-browsing/]
---
class: normal
count: false
### История про медленный NuGet-сервер
.up[]
.center[]
.bottom-hint-huge[Andrey Akinshin. "A story about slow NuGet package browsing." (2018)
https://aakinshin.net/posts/nuget-package-browsing/]
---
class: normal
count: false
### История про медленный NuGet-сервер
.up[]
.center[]
.bottom-hint-huge[Andrey Akinshin. "A story about slow NuGet package browsing." (2018)
https://aakinshin.net/posts/nuget-package-browsing/]
---
class: normal
count: false
### История про медленный NuGet-сервер
.up[]
.center[]
.bottom-hint-huge[Andrey Akinshin. "A story about slow NuGet package browsing." (2018)
https://aakinshin.net/posts/nuget-package-browsing/]
---
class: normal
count: false
### История про медленный NuGet-сервер
.up[]
.center[]
.bottom-hint-huge[Andrey Akinshin. "A story about slow NuGet package browsing." (2018)
https://aakinshin.net/posts/nuget-package-browsing/]
---
class: normal
count: false
### История про медленный NuGet-сервер
.up[]
.center[]
.bottom-hint-huge[Andrey Akinshin. "A story about slow NuGet package browsing." (2018)
https://aakinshin.net/posts/nuget-package-browsing/]
---
class: normal
count: false
### История про медленный NuGet-сервер
.up[]
.center[]
.bottom-hint-huge[Andrey Akinshin. "A story about slow NuGet package browsing." (2018)
https://aakinshin.net/posts/nuget-package-browsing/]
---
class: normal
count: false
### История про медленный NuGet-сервер
.up[]
.center[]
.bottom-hint-huge[Andrey Akinshin. "A story about slow NuGet package browsing." (2018)
https://aakinshin.net/posts/nuget-package-browsing/]
---
class: normal
### Нужно запомнить
.memorize[Анализировать историю
полезно]
---
template: template-comics
.center[]
.comics[
У меня нашлось 600 точек разладки.
Что с ними делать?
]
---
template: template-section
## Часть 6
## Анализируем точки разладки
---
layout: true
template: template-page
.footer-note[(6) Анализируем точки разладки]
---
class: normal
### Сводная таблица
.up[]
.center[**Худшие деградации**]
.up1[]
| Тест | Сдвиг (секунды) | Пропорция |
| ------------------- | ---------------------: | ----------------------------------------: |
| .color-bad[Test472] | .color-bad[19.7..22.4] |
35.3..48.9 |
| .color-bad[Test982] | .color-bad[0.8.. 1.5] |
10.0..12.0 |
| Test872 | 0.2.. 0.3 | 1.1.. 1.2 |
| Test375 | 0.1.. 0.2 | 1.0.. 1.1 |
| Test184 | -0.1.. 0.0 | 0.9.. 1.0 |
| Test592 | -0.1.. 0.0 | 0.9.. 1.0 |
| Test824 | -0.1.. 0.0 | 0.9.. 1.0 |
| Test294 | -0.1.. 0.0 | 0.9.. 1.0 |
| Test235 | -0.1.. 0.0 | 0.9.. 1.0 |
| Test948 | -0.1.. 0.0 | 0.9.. 1.0 |
---
class: normal
### Сводные таблицы по целому распределению
--
.dashboard-table[
 |
|
Дисперсия |
|
|
|
|
|
]
---
class: normal
count: false
### Сводные таблицы по целому распределению
.dashboard-table[
 |
 |
Дисперсия |
Мультимодальность |
|
|
|
|
]
---
class: normal
count: false
### Сводные таблицы по целому распределению
.dashboard-table[
 |
 |
Дисперсия |
Мультимодальность |
 |
|
Процентиль |
|
]
---
class: normal
count: false
### Сводные таблицы по целому распределению
.dashboard-table[
 |
 |
Дисперсия |
Мультимодальность |
 |
 |
Процентиль |
Выбросы |
]
---
class: normal
### Ищем разладки в реальной жизни
--
.up[]
.center[]
???
В теории нет разницы между теорией и практикой. А на практике есть.
---
class: normal
count: false
### Ищем разладки в реальной жизни
.up[]
.center[]
--
.up[]
```cs
var changePoints = GetChangePoints(durations);
for (var cp in changePoints)
if (IsNotReported(cp))
SendAlarm(cp);
```
---
class: normal
count: false
### Ищем разладки в реальной жизни
.up[]
.center[]
.up[]
```cs
var changePoints = GetChangePoints(durations);
for (var cp in changePoints)
if (IsNotReported(cp))
SendAlarm(cp);
```
---
class: normal
count: false
### Ищем разладки в реальной жизни
.up[]
.center[]
.up[]
```cs
var changePoints = GetChangePoints(durations);
for (var cp in changePoints)
if (IsNotReported(cp))
SendAlarm(cp);
```
---
class: normal
count: false
### Ищем разладки в реальной жизни
.up[]
.center[]
.up[]
```cs
var changePoints = GetChangePoints(durations);
for (var cp in changePoints)
if (IsNotReported(cp) && `cp.Date.DayOfWeek != DayOfWeek.Saturday &&`
`cp.Date.DayOfWeek != DayOfWeek.Monday`)
SendAlarm(cp);
```
---
class: normal
count: false
### Ищем разладки в реальной жизни
.up[]
.center[]
.up[]
```cs
var changePoints = GetChangePoints(durations);
for (var cp in changePoints)
if (IsNotReported(cp) && cp.Date.DayOfWeek != DayOfWeek.Saturday &&
cp.Date.DayOfWeek != DayOfWeek.Monday)
SendAlarm(cp);
```
---
class: normal
count: false
### Ищем разладки в реальной жизни
.up[]
.center[]
.up[]
```cs
var changePoints = GetChangePoints(durations);
for (var cp in changePoints)
if (IsNotReported(cp) && cp.Date.DayOfWeek != DayOfWeek.Saturday &&
cp.Date.DayOfWeek != DayOfWeek.Monday)
SendAlarm(cp);
```
---
class: normal
### Смотрим на железо
--
.up[]
.center[]
---
class: normal
count: false
### Смотрим на железо
.up[]
.center[]
---
class: normal
count: false
### Смотрим на железо
.up[]
.center[]
---
class: normal
count: false
### Смотрим на железо
.up[]
.center[]
---
class: normal
count: false
### Смотрим на железо
.up[]
.center[]
---
class: normal
### Строим модель нагрузки
--
.up[]
.center[]
---
class: normal
count: false
### Строим модель нагрузки
.up[]
.center[]
---
class: normal
count: false
### Строим модель нагрузки
.up[]
.center[]
---
class: normal
count: false
### Строим модель нагрузки
.up[]
.center[]
---
class: normal
count: false
### Строим модель нагрузки
.up[]
.center[]
---
class: normal
count: false
### Строим модель нагрузки
.up[]
.center[]
---
class: normal
count: false
### Строим модель нагрузки
.up[]
.center[]
---
class: normal
count: false
### Строим модель нагрузки
.up[]
.center[]
---
class: normal
count: false
### Строим модель нагрузки
.up[]
.center[]
---
class: normal
count: false
### Строим модель нагрузки
.up[]
.center[]
---
class: normal
count: false
### Строим модель нагрузки
.up[]
.center[]
---
class: normal
count: false
### Строим модель нагрузки
.up[]
.center[]
---
class: normal
count: false
### Строим модель нагрузки
.up[]
.center[]
---
class: normal
count: false
### Строим модель нагрузки
.up[]
.center[]
---
class: normal
count: false
### Строим модель нагрузки
.up[]
.center[]
---
class: normal
count: false
### Строим модель нагрузки
.up[]
.center[]
---
class: normal
count: false
### Строим модель нагрузки
.up[]
.center[]
---
class: normal
count: false
### Строим модель нагрузки
.up[]
.center[]
---
class: normal
count: false
### Строим модель нагрузки
.up[]
.center[]
---
class: normal
count: false
### Строим модель нагрузки
.up[]
.center[]
---
class: normal
### Нужно запомнить
.memorize[Не используйте магические числа,
используйте сортировку]
---
template: template-comics
.center[]
.comics[
Не хочу узнавать о деградациях спустя неделю, хочу узнавать о них сразу!
]
---
template: template-section
## Часть 7
## Пишем перфомансные тесты
---
layout: true
template: template-page
.footer-note[(7) Пишем перфомансные тесты]
---
class: normal
### Абсолютное условие
--
.up[]
```cs
[Test, Timeout(`2000`)]
public void Benchmark()
{
// ...
}
```
---
class: normal
### Относительное условие
--
.up[]
```cs
private long baseline;
public void Baseline()
{
var sw = Stopwatch.StartNew();
// ...
sw.Stop();
baseline = sw.ElapsedMilliseconds;
}
```
--
```cs
public void Benchmark()
{
var sw = Stopwatch.StartNew();
// ...
sw.Stop();
if (sw.ElapsedMilliseconds / baseline > `2`)
Assert.Fail();
}
```
---
class: normal
### Адаптивное условие
--
```cs
public void Benchmark(string name)
{
⠀⠀⠀⠀
⠀⠀⠀⠀
⠀⠀⠀⠀
⠀⠀⠀⠀
⠀⠀⠀⠀
⠀⠀⠀⠀
}
```
---
class: normal
count: false
### Адаптивное условие
```cs
public void Benchmark(string name)
{
var history = LoadHistoryFromDatabase(name);
⠀⠀⠀⠀
⠀⠀⠀⠀
⠀⠀⠀⠀
⠀⠀⠀⠀
⠀⠀⠀⠀
}
```
---
class: normal
count: false
### Адаптивное условие
```cs
public void Benchmark(string name)
{
var history = LoadHistoryFromDatabase(name);
var current = new List
();
for (int i = 0; i < `N`; i++)
current.Add(Measure(name));
⠀⠀⠀⠀
⠀⠀⠀⠀
}
```
---
class: normal
count: false
### Адаптивное условие
```cs
public void Benchmark(string name)
{
var history = LoadHistoryFromDatabase(name);
var current = new List();
for (int i = 0; i < `N`; i++)
current.Add(Measure(name));
if (HasDegradation(history, current))
Assert.Fail();
}
```
---
class: normal
### Статистический последовательный анализ
--
.center[]
---
class: normal
count: false
### Статистический последовательный анализ
.center[]
---
class: normal
count: false
### Статистический последовательный анализ
.center[]
---
class: normal
count: false
### Статистический последовательный анализ
.center[]
---
class: normal
count: false
### Статистический последовательный анализ
.center[]
---
class: normal
count: false
### Статистический последовательный анализ
.center[]
---
class: normal
count: false
### Статистический последовательный анализ
.center[]
---
class: normal
### Как принять решение? (Пример)
--
.up[]
.center[]
---
class: normal
count: false
### Как принять решение? (Пример)
.up[]
.center[]
---
class: normal
count: false
### Как принять решение? (Пример)
.up[]
.center[]
---
class: normal
count: false
### Как принять решение? (Пример)
.up[]
.center[]
---
class: normal
count: false
### Как принять решение? (Пример)
.up[]
.center[]
---
class: normal
count: false
### Как принять решение? (Пример)
.up[]
.center[]
---
class: normal
count: false
### Как принять решение? (Пример)
.up[]
.center[]
---
class: normal
count: false
### Как принять решение? (Пример)
.up[]
.center[]
---
class: normal
count: false
### Как принять решение? (Пример)
.up[]
.center[]
---
class: normal
count: false
### Как принять решение? (Пример)
.up[]
.center[]
---
class: normal
count: false
### Как принять решение? (Пример)
.up[]
.center[]
---
class: normal
### Реальная жизнь
--
.up[]
.center[]
---
class: normal
count: false
### Реальная жизнь
.up[]
.center[]
---
class: normal
count: false
### Реальная жизнь
.up[]
.center[]
---
class: normal
count: false
### Реальная жизнь
.up[]
.center[]
---
class: normal
### Нужно запомнить
.memorize[Перфоманс-тесты
должны быть адаптивными]
---
template: template-comics
.center[]
.comics[
Звучит сложно, вряд ли сходу получится это внедрить на нашем проекте.
]
---
template: template-section
## Часть 8
## Допускаем много ошибок
---
layout: true
template: template-page
.footer-note[(8) Допускаем много ошибок]
---
class: normal
### Томас Уотсон старший
.up4[]
.center-wide[]
---
class: normal
### Ошибки были допущены
.up3[]
.center[]
---
class: normal
### Написание постмортемов
--
.up4[]
.center-wide[]
---
class: normal
### Кросс-бенчмаркинг
--
.up3[]
.center-wide[]
---
class: normal
count: false
### Кросс-бенчмаркинг
.up3[]
.center-wide[]
---
class: normal
### Полезные советы
--
* Не стесняйтесь допускать ошибки
--
* Не стесняйтесь признавать ошибки
--
* Пишите постмортемы
--
* Используйте кросс-бенчмаркинг
--
* Получайте удовольствие от ошибок
--
.vspace5[]
> Самая волнующая фраза, какую можно услышать в науке,
> вовсе не *«Эврика!»*, а *«Это забавно…»*
>
> — Айзек Азимов.superscript[1]
.bottom-hint-huge[.superscript[1]https://quoteinvestigator.com/2015/03/02/eureka-funny/]
---
class: normal
### Карл Поппер
.up3[]
.center-wide[]
???
Однажды у Карла Поппера спросили, можно ли «фальсифицировать фальсификацию».
То есть можно ли проявить скептицизм по отношению к самой концепции скептицизма.
Карл Поппер ответил, что выгонял студентов с лекций и за менее тупые вопросы.
---
class: normal
### Нужно запомнить
.memorize[Допускать ошибки —
это круто!]
---
template: template-comics
.center[]
.comics[
Я одну половину доклада не запомнил, а другую не понял.
Что бы мне почитать на тему
перфоманс-анализа?
]
---
template: template-section
## Часть 9
## Читаем методическую литературу
---
layout: true
template: template-page
.footer-note[(9) Читаем методическую литературу]
---
class: normal
### Хорошие книжки
.up[]
---
class: normal
### Про способность находить закономерности
.cite-block[
* Tversky, Amos, and Daniel Kahneman. "Belief in the law of small numbers." Psychological bulletin 76, no. 2 (1971): 105.
http://www.stats.org.uk/statistical-inference/TverskyKahneman1971.pdf
* Панчин, Александр. "Апофения." СПб.: Питер, 2019. — 256 с. ISBN 978-5-4461-1086-5
https://www.goodreads.com/book/show/22846024
* Taleb, Nassim. Fooled by randomness: The hidden role of chance in life and in the markets. Vol. 1. Random House Incorporated, 2005.
https://www.fooledbyrandomness.com/
]
---
class: normal
### Про статистические тесты
.cite-block[
* Cohen, Jacob. "The earth is round (p<. 05)." In What if there were no significance tests?, pp. 69-82. Routledge, 2016.
https://pdfs.semanticscholar.org/fa63/cbf9b514a9bc4991a0ef48542b689e2fa08d.pdf
* Amrhein, Valentin, Fränzi Korner-Nievergelt, and Tobias Roth. "The earth is flat (p> 0.05): significance thresholds and the crisis of unreplicable research." PeerJ 5 (2017): e3544.
https://www.ncbi.nlm.nih.gov/pmc/articles/PMC5502092/
* Wasserstein, Ronald L., Allen L. Schirm, and Nicole A. Lazar. "Moving to a world beyond “p< 0.05”." (2019): 1-19.
https://www.tandfonline.com/doi/full/10.1080/00031305.2019.1583913
* Winder, W. C. "What you always wanted to know about testing but were afraid to ask." American dairy review (1973).
https://www.researchgate.net/publication/241372934
* Grieve, Andrew P. "How to test hypotheses if you must." Pharmaceutical statistics 14, no. 2 (2015): 139-150.
http://doi.wiley.com/10.1002/pst.1667
* Krawczyk, Michał. "The search for significance: a few peculiarities in the distribution of P values in experimental psychology literature." PloS one 10, no. 6 (2015).
https://dx.plos.org/10.1371/journal.pone.0127872
]
---
class: normal
### Про cтатистический последовательный анализ
.cite-block[
* Lakens, Daniël. "Performing high‐powered studies efficiently with sequential analyses." European Journal of Social Psychology 44, no. 7 (2014): 701-710.
http://doi.wiley.com/10.1002/ejsp.2023
]
---
class: normal
### Про размер эффекта
.cite-block[
* Peng, Chao-Ying Joanne, and Li-Ting Chen. "Beyond Cohen's d: Alternative effect size measures for between-subject designs." The Journal of Experimental Education 82, no. 1 (2014): 22-50.
http://www.tandfonline.com/doi/abs/10.1080/00220973.2012.745471
* Wilcox, Rand. "A Robust Nonparametric Measure of Effect Size Based on an Analog of Cohen's d, Plus Inferences About the Median of the Typical Difference." Journal of Modern Applied Statistical Methods 17, no. 2 (2019): 1.
https://digitalcommons.wayne.edu/jmasm/vol17/iss2/1
* Tomczak, Maciej, and Ewa Tomczak. "The need to report effect size estimates revisited. An overview of some recommended measures of effect size." (2014).
https://www.researchgate.net/publication/303919832
]
---
class: normal
### Про функцию сдвига
.cite-block[
* Doksum, Kjell. "Empirical probability plots and statistical inference for nonlinear models in the two-sample case." The annals of statistics (1974): 267-277.
https://doi.org/10.1214/aos/1176342662
* Doksum, Kjell A., and Gerald L. Sievers. "Plotting with confidence: Graphical comparisons of two populations." Biometrika 63, no. 3 (1976): 421-434.
https://doi.org/10.2307/2335720
* Rousselet, Guillaume. "the shift function: a powerful tool to compare two entire distributions." 2016
https://garstats.wordpress.com/2016/07/12/shift-function/
* Rousselet, Guillaume. "Bayesian shift function." (2018)
https://garstats.wordpress.com/2018/04/06/bsf/
* Akinshin, Andrey. "Distribution comparison via the shift and ratio functions." (2019)
https://aakinshin.net/posts/shift-and-ratio-functions/
]
---
class: normal
### Про разладку
.cite-block[
* Haynes, Kaylea, Paul Fearnhead, and Idris A. Eckley. "A computationally efficient nonparametric approach for changepoint detection." Statistics and Computing 27, no. 5 (2017): 1293-1305.
https://link.springer.com/article/10.1007/s11222-016-9687-5
* Akinshin, Andrey. "Implementation of efficient algorithm for changepoint detection: ED-PELT." (2019)
https://aakinshin.net/posts/edpelt/
]
---
class: normal
### Про k-й наименьший элемент
.cite-block[
* Gagie, Travis, Simon J. Puglisi, and Andrew Turpin. "Range quantile queries: Another virtue of wavelet trees." In International Symposium on String Processing and Information Retrieval, pp. 1-6. Springer, Berlin, Heidelberg, 2009.
https://arxiv.org/pdf/0903.4726.pdf
* Alexandrescu, Andrei. "Fast deterministic selection." arXiv preprint arXiv:1606.00484 (2016).
http://erdani.com/research/sea2017.pdf
]
---
class: normal
### Про квантильные оценки
.cite-block[
* Harrell, Frank E., and C. E. Davis. "A new distribution-free quantile estimator." Biometrika 69, no. 3 (1982): 635-640.
http://biomet.oxfordjournals.org/content/69/3/635.abstract
]
---
class: normal
### Как не надо делать
--
.up[]
.center[[](https://sci-hub.se/)]
--
.center[[](https://twitter.com/Protohedgehog/status/1005837592275881984)]
---
class: normal
### Нужно запомнить
.memorize[Никогда не переставайте
изучать]
---
template: template-comics
.center[]
.comics[
Я устал.
Давай заканчивать, нужно передохнуть.
]
---
template: template-section
## Часть 10
## Резюмируем изученную информацию
---
layout: true
template: template-page
.footer-note[(10) Резюмируем изученную информацию]
---
class: normal
### Советы перфоманс-инженерам
--
.result-table[
 |
|
|
Образовывайтесь |
|
|
|
|
|
|
|
|
]
---
class: normal
count: false
### Советы перфоманс-инженерам
.result-table[
 |
 |
|
Образовывайтесь |
Анализируйте |
|
|
|
|
|
|
|
]
---
class: normal
count: false
### Советы перфоманс-инженерам
.result-table[
 |
 |
 |
Образовывайтесь |
Анализируйте |
Адаптируйтесь |
|
|
|
|
|
|
]
---
class: normal
count: false
### Советы перфоманс-инженерам
.result-table[
 |
 |
 |
Образовывайтесь |
Анализируйте |
Адаптируйтесь |
 |
|
|
Сомневайтесь |
|
|
]
---
class: normal
count: false
### Советы перфоманс-инженерам
.result-table[
 |
 |
 |
Образовывайтесь |
Анализируйте |
Адаптируйтесь |
 |
 |
|
Сомневайтесь |
Думайте |
|
]
---
class: normal
count: false
### Советы перфоманс-инженерам
.result-table[
 |
 |
 |
Образовывайтесь |
Анализируйте |
Адаптируйтесь |
 |
 |
 |
Сомневайтесь |
Думайте |
Ошибайтесь |
]
---
class: normal
count: false
### Советы любым инженерам
.result-table[
 |
 |
 |
Образовывайтесь |
Анализируйте |
Адаптируйтесь |
 |
 |
 |
Сомневайтесь |
Думайте |
Ошибайтесь |
]
---
layout: true
template: template-page
---
template: template-comics
.center[]
.comics[
Пишите быстрые программы!
]
---
template: template-comics
.credits-header1[Титры]
.credits-header2[Главные герои]
Перфолозавр |  |
Перфолитка |  |
Менеджер | 🐙 |
Перфоманс-инженер | 🐵 |
Статистические тесты | 👻💩 |
.credits-header2[Визуальное оформление]
.credits-block[
* Beamer theme gallery: Pittsburgh
http://deic.uab.es/~iblanes/beamer_gallery/individual/Pittsburgh-default-default.html
*(
Оформление слайдов)*
* Okabe, Masataka, and Kei Ito. "Color universal design (cud)-how to make figures and presentations that are friendly to colorblind people." J Fly: Data Depository for Drosophila Researchers (2008).
https://jfly.uni-koeln.de/color/
*(
Цветовая палитра графиков адаптированная для дальтоников)*
]
.credits-header2[Создание презентации]
.credits-block[
* remark: A simple, in-browser, markdown-driven slideshow tool
https://github.com/gnab/remark
*(Движок для этой презентации)*
]
.credits-header2[Графики и иллюстрации]
.credits-block[
* Wickham, Hadley. "ggplot2." Wiley Interdisciplinary Reviews: Computational Statistics 3, no. 2 (2011): 180-185.
https://ggplot2.tidyverse.org/
*(Графики)*
* R package with functions for drawing density and frequency trail waterfall plots
https://github.com/AndreyAkinshin/ggwaterfall
*(Каскадные графики)*
*
Sketchviz
https://sketchviz.com/
*(Блок-схемы)*
* Grapholite: State-of-the-art diagrams editor for Desktop, iPad and Windows 10 tablets
https://grapholite.com/
(Диаграммы)
* Adobe Illustrator
https://www.adobe.com/products/illustrator.html
(Иллюстрации)
* Paint.NET
https://www.getpaint.net/
(Иллюстрации)
]
.credits-header2[Основные шрифты]
.credits-block[
*
Ubuntu Mono
https://fonts.google.com/specimen/Ubuntu+Mono
(Шрифт для текста)
*
Iosevka
https://github.com/be5invis/Iosevka
(Шрифт для кода)
*
Caveat
https://fonts.google.com/specimen/Caveat
(Шрифт для комиксов)
*
Tinos
https://fonts.google.com/specimen/Tinos
(Шрифт для блок-схем)
]
.credits-header2[Оборудование для эксперимента с термальным троттлингом]
.credits-block[
* MacBook Pro (Retina, 15-inch, Mid 2015, 2,5 GHz Quad-Core Intel Core i7, 16 GB 1600 MHz DDR3)
* Тепловентилятор керамический Vitek VT-2052
* Плед ИГАБРИТТА из IKEA
* Холодильник NEFF
* Тепловизор Seek Thermal Compact для Android
]
.credits-header2[Используемые и упомянутые интернет-ресурсы]
.credits-block[
* https://en.wikipedia.org/
* https://getemoji.com/
* https://sci-hub.se/
* https://twitter.com/Protohedgehog/status/1005837592275881984
]
.credits-header2[Музыка]
.credits-block[
* Музыка для титров
Royalty Free Music from Bensound
https://www.bensound.com/royalty-free-music/track/ukulele
]
.credits-header2[Источники фотографий]
.credits-block[
* Карл Поппер
http://www.popper-symposium.de/
* Томас Уотсон старший
https://ultimatepeter.com/thomas-john-watson-sr-ibm/
* Craig M. Bennett
https://www.brainmapping.org/directory/index.php?userid=382
* Abigail A. Baird
https://www.vassar.edu/faculty/abbaird/
* Michael B. Miller
https://www.psych.ucsb.edu/people/michael-miller
* George L. Wolford
https://pbs.dartmouth.edu/people/george-wolford
* Биткоины
Photo by Thought Catalog on Unsplash
https://unsplash.com/photos/bj8U389A9N8
]
.credits-header2[Благодарности людям, которые помогли подготовить материал]
.credits-block[
* Иван Пащенко
* Алина Смирнова
* Константин Хоматьяно
* Сергей Кукс
]
.credits-header2[Вдходновение для иллюстраций]
.credits-block[
* Слайд "Типичный день перфоманс-инженера"
Charmander the Firefighter
https://www.youtube.com/watch?v=nW-PA3lEqnA
* Слайд "Кросс-бенчмаркинг"
Инструкция по сборке IKEA
https://www.ikea.com/ru/ru/assembly_instructions/kallaks-stellaz__AA-1055145-6_pub.pdf
]
.credits-header2[Библиография]
.credits-block[
* Tversky, Amos, and Daniel Kahneman. "Belief in the law of small numbers." Psychological bulletin 76, no. 2 (1971): 105.
http://www.stats.org.uk/statistical-inference/TverskyKahneman1971.pdf
* Панчин, Александр. "Апофения." СПб.: Питер, 2019. — 256 с. ISBN 978-5-4461-1086-5
https://www.goodreads.com/book/show/22846024
* Taleb, Nassim. Fooled by randomness: The hidden role of chance in life and in the markets. Vol. 1. Random House Incorporated, 2005.
https://www.fooledbyrandomness.com/
* Cohen, Jacob. "The earth is round (p<. 05)." In What if there were no significance tests?, pp. 69-82. Routledge, 2016.
https://pdfs.semanticscholar.org/fa63/cbf9b514a9bc4991a0ef48542b689e2fa08d.pdf
* Amrhein, Valentin, Fränzi Korner-Nievergelt, and Tobias Roth. "The earth is flat (p> 0.05): significance thresholds and the crisis of unreplicable research." PeerJ 5 (2017): e3544.
https://www.ncbi.nlm.nih.gov/pmc/articles/PMC5502092/
* Wasserstein, Ronald L., Allen L. Schirm, and Nicole A. Lazar. "Moving to a world beyond “p< 0.05”." (2019): 1-19.
https://www.tandfonline.com/doi/full/10.1080/00031305.2019.1583913
* Winder, W. C. "What you always wanted to know about testing but were afraid to ask." American dairy review (1973).
https://www.researchgate.net/publication/241372934
* Grieve, Andrew P. "How to test hypotheses if you must." Pharmaceutical statistics 14, no. 2 (2015): 139-150.
http://doi.wiley.com/10.1002/pst.1667
* Krawczyk, Michał. "The search for significance: a few peculiarities in the distribution of P values in experimental psychology literature." PloS one 10, no. 6 (2015).
https://dx.plos.org/10.1371/journal.pone.0127872
* Lakens, Daniël. "Performing high‐powered studies efficiently with sequential analyses." European Journal of Social Psychology 44, no. 7 (2014): 701-710.
http://doi.wiley.com/10.1002/ejsp.2023
* Peng, Chao-Ying Joanne, and Li-Ting Chen. "Beyond Cohen's d: Alternative effect size measures for between-subject designs." The Journal of Experimental Education 82, no. 1 (2014): 22-50.
http://www.tandfonline.com/doi/abs/10.1080/00220973.2012.745471
* Wilcox, Rand. "A Robust Nonparametric Measure of Effect Size Based on an Analog of Cohen's d, Plus Inferences About the Median of the Typical Difference." Journal of Modern Applied Statistical Methods 17, no. 2 (2019): 1.
https://digitalcommons.wayne.edu/jmasm/vol17/iss2/1
* Tomczak, Maciej, and Ewa Tomczak. "The need to report effect size estimates revisited. An overview of some recommended measures of effect size." (2014).
https://www.researchgate.net/publication/303919832
* Doksum, Kjell. "Empirical probability plots and statistical inference for nonlinear models in the two-sample case." The annals of statistics (1974): 267-277.
https://doi.org/10.1214/aos/1176342662
* Doksum, Kjell A., and Gerald L. Sievers. "Plotting with confidence: Graphical comparisons of two populations." Biometrika 63, no. 3 (1976): 421-434.
https://doi.org/10.2307/2335720
* Rousselet, Guillaume. "the shift function: a powerful tool to compare two entire distributions." 2016
https://garstats.wordpress.com/2016/07/12/shift-function/
* Rousselet, Guillaume. "Bayesian shift function." (2018)
https://garstats.wordpress.com/2018/04/06/bsf/
* Akinshin, Andrey. "Distribution comparison via the shift and ratio functions." (2019)
https://aakinshin.net/posts/shift-and-ratio-functions/
* Haynes, Kaylea, Paul Fearnhead, and Idris A. Eckley. "A computationally efficient nonparametric approach for changepoint detection." Statistics and Computing 27, no. 5 (2017): 1293-1305.
https://link.springer.com/article/10.1007/s11222-016-9687-5
* Akinshin, Andrey. "Implementation of efficient algorithm for changepoint detection: ED-PELT." (2019)
https://aakinshin.net/posts/edpelt/
* Gagie, Travis, Simon J. Puglisi, and Andrew Turpin. "Range quantile queries: Another virtue of wavelet trees." In International Symposium on String Processing and Information Retrieval, pp. 1-6. Springer, Berlin, Heidelberg, 2009.
https://arxiv.org/pdf/0903.4726.pdf
* Alexandrescu, Andrei. "Fast deterministic selection." arXiv preprint arXiv:1606.00484 (2016).
http://erdani.com/research/sea2017.pdf
* Harrell, Frank E., and C. E. Davis. "A new distribution-free quantile estimator." Biometrika 69, no. 3 (1982): 635-640.
http://biomet.oxfordjournals.org/content/69/3/635.abstract
* Geary, Roy Charles. "Testing for normality." Biometrika 34, no. 3/4 (1947): 209-242.
* Anscombe, Francis J. "Graphs in statistical analysis." The american statistician 27, no. 1 (1973): 17-21.
https://doi.org/10.1080%2F00031305.1973.10478966
* Matejka, Justin, and George Fitzmaurice. "Same stats, different graphs: generating datasets with varied appearance and identical statistics through simulated annealing." In Proceedings of the 2017 CHI Conference on Human Factors in Computing Systems, pp. 1290-1294. 2017.
https://www.autodeskresearch.com/publications/samestats
http://dx.doi.org/10.1145/3025453.3025912
* Bennet, C., A. Baird, M. Miller, and G. Wolford. "Neural correlates of interspecies perspective taking in the post-mortem Atlantic salmon: An argument for proper multiple comparisons correction." Journal of Serendipitous and Unexpected Results 1, no. 1 (2010): 1-5.
http://dx.doi.org/10.1016/S1053-8119(09)71202-9
https://teenspecies.github.io/pdfs/NeuralCorrelates.pdf
http://prefrontal.org/files/posters/Bennett-Salmon-2009.pdf
* Perezgonzalez, Jose D. "Fisher, Neyman-Pearson or NHST? A tutorial for teaching data testing." Frontiers in Psychology 6 (2015): 223.
https://doi.org/10.3389/fpsyg.2015.00223
]
.credits-header2[Хорошие инструменты]
.center[]
.center[

]
.center[

]
.credits-header2[Организаторы конференции]
.center[]