Skip to content

Feature/navbar collpase optimisation #12

Merged
merged 11 commits into from
Jul 21, 2018
Merged

Feature/navbar collpase optimisation #12

merged 11 commits into from
Jul 21, 2018

Conversation

roll314
Copy link
Contributor

@roll314 roll314 commented Jul 5, 2018

@fost

200 000 запусков с различным (случайным) кол-м элементов для схлопывания
Время указано без учета отрисовки

Не оптимизированый вариант

Google Chrome
4.67507360048536 (ns)

Firefox
5.05437921458204 (ns)

Edge
5.04821571180474 (ns)

Оптимизированый нативный варинат

Google Chrome
0.2304445221024541 (ns)

Firefox
0.3454046790842149 (ns)

Edge
0.3523217045234725 (ns)

Angular way (время без учета времени обработки изменения angular)
визуально выглядит чуть чуть похуже чем нативный вариант.
Возможно стоит устанавливать класс нативно, но дожидаясь обработки angular.
Введена опция allowSetClassNative у McNavbarTitle в качестве внутренней настройки

Google Chrome
0.2525322296627511 (ns)

Firefox
0.2962355475514478 (ns)

Edge
0.2999287502285111 (ns)

public itemsForCollapse: CachedCollapsedItemWidth[] = []
) {}

setCollapsed(collapsed: boolean): number {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

реализовать метод по его названию

@@ -6,5 +6,5 @@ export function toBoolean(value: any): boolean {
}

export function isNotNil(value: any): boolean {
return value !== 'undefined' && value !== null;
return value !== undefined && value !== null;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

turn on --strictNullChecks (for Webpack dev build)

@include mc-typography-level-to-styles($config, body);
}

.mc-navbar-left, .mc-navbar-right, .mc-navbar-brand {
.mc-navbar-item {
> mc-navbar-title > .mc-navbar-title, > .mc-navbar-title {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

очень ждем этой правки

@pimenovoleg pimenovoleg merged commit afb16de into positive-js:master Jul 21, 2018
@roll314 roll314 deleted the feature/navbar_collpase-optimisation branch October 25, 2018 07:38
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants