-
Notifications
You must be signed in to change notification settings - Fork 71
igor-arkhipov/performance-improvement-5 #101
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
Open
IgorArkhipov
wants to merge
3
commits into
hardcode-dev:master
Choose a base branch
from
IgorArkhipov:igor-arkhipov/performance-improvement-5
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+176
−22
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| 2.6.1 | ||
| 2.7.7 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| # Case-study оптимизации | ||
|
|
||
| ## сравнение `HAR`-файлов с `server-push` и без | ||
|
|
||
| Отправной точкой работы над проектом стало создание локального корневого сертификата и подписывание им сертификата для localhost. Был установлен nginx, и произведена настройка HTTP2 с включением опции `server-push`. | ||
| Для совместимости с локальной системой была обновлена версия Ruby до 2.7.7. | ||
|
|
||
| После этого в файле `app/views/layouts/_top_bar.html.erb` были согласно заданию заменены `inline_svg` команды для ряда изображений на стандартный `image_tag`. | ||
|
|
||
| В итоге было запущено тестирование главной страницы сайта как с включенной предзагрузкой изображений через команды в заголовке, так и без этой опции. | ||
|
|
||
| Результаты были сопоставлены на сайте `https://compare.sitespeed.io/`. | ||
| По их результатам можно сделать следующие выводы: | ||
| * Для первой загрузки: | ||
| * Без принудительной загрузки картинок время отображения страницы отставало: до первого появления элементов на странице прошло сравнительно одинаковое время 0.27-0.3 сек, однако эти же 0.3 сек позволили оптимизированной версии отрисовать страницу на 98%, когда без `server-push` на это потребовалось 0.43 сек. | ||
| * Для второй загрузки: | ||
| * 0,34 секунды потребовалось версии без оптимизации для отрисовывания первых элементов и 0,4 сек для полной загрузки. Для версии с `server-push` это 0,27 и 0,33 сек соответственно. | ||
| * 9-27 мс против 20-43 мс составило время загрузки изображений, которые мы добавили в первоначальный ответ сервера, это видно в разделе `Waterfall` отчета. | ||
|
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. 👍 |
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,126 @@ | ||
|
|
||
| #user nobody; | ||
| worker_processes 1; | ||
|
|
||
| #error_log logs/error.log; | ||
| #error_log logs/error.log notice; | ||
| #error_log logs/error.log info; | ||
|
|
||
| #pid logs/nginx.pid; | ||
|
|
||
|
|
||
| events { | ||
| worker_connections 1024; | ||
| } | ||
|
|
||
|
|
||
| http { | ||
| include mime.types; | ||
| default_type application/octet-stream; | ||
|
|
||
| #log_format main '$remote_addr - $remote_user [$time_local] "$request" ' | ||
| # '$status $body_bytes_sent "$http_referer" ' | ||
| # '"$http_user_agent" "$http_x_forwarded_for"'; | ||
|
|
||
| #access_log logs/access.log main; | ||
|
|
||
| sendfile on; | ||
| #tcp_nopush on; | ||
|
|
||
| #keepalive_timeout 0; | ||
| keepalive_timeout 65; | ||
|
|
||
| #gzip on; | ||
|
|
||
| server { | ||
| listen 8080; | ||
| server_name localhost; | ||
|
|
||
| #charset koi8-r; | ||
|
|
||
| #access_log logs/host.access.log main; | ||
|
|
||
| location / { | ||
| root html; | ||
| index index.html index.htm; | ||
| } | ||
|
|
||
| #error_page 404 /404.html; | ||
|
|
||
| # redirect server error pages to the static page /50x.html | ||
| # | ||
| error_page 500 502 503 504 /50x.html; | ||
| location = /50x.html { | ||
| root html; | ||
| } | ||
|
|
||
| # proxy the PHP scripts to Apache listening on 127.0.0.1:80 | ||
| # | ||
| #location ~ \.php$ { | ||
| # proxy_pass http://127.0.0.1; | ||
| #} | ||
|
|
||
| # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 | ||
| # | ||
| #location ~ \.php$ { | ||
| # root html; | ||
| # fastcgi_pass 127.0.0.1:9000; | ||
| # fastcgi_index index.php; | ||
| # fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name; | ||
| # include fastcgi_params; | ||
| #} | ||
|
|
||
| # deny access to .htaccess files, if Apache's document root | ||
| # concurs with nginx's one | ||
| # | ||
| #location ~ /\.ht { | ||
| # deny all; | ||
| #} | ||
| } | ||
|
|
||
|
|
||
| # another virtual host using mix of IP-, name-, and port-based configuration | ||
| # | ||
| #server { | ||
| # listen 8000; | ||
| # listen somename:8080; | ||
| # server_name somename alias another.alias; | ||
|
|
||
| # location / { | ||
| # root html; | ||
| # index index.html index.htm; | ||
| # } | ||
| #} | ||
|
|
||
|
|
||
| # HTTPS server | ||
| # | ||
| server { | ||
| listen 443 http2 ssl; | ||
| server_name localhost; | ||
|
|
||
| ssl_certificate "/Users/igor.arkhipov/Library/Application Support/mkcert/localhost+2.pem"; | ||
| ssl_certificate_key "/Users/igor.arkhipov/Library/Application Support/mkcert/localhost+2-key.pem"; | ||
|
|
||
| #ssl_session_cache shared:SSL:1m; | ||
| ssl_session_timeout 5m; | ||
| ssl_protocols TLSv1 TLSv1.1 TLSv1.2; | ||
| ssl_ciphers 'ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:AES:DES-CBC3-SHA:!RC4:!aNULL:!eNULL:!MD5:!EXPORT:!EXP:!LOW:!SEED:!CAMELLIA:!IDEA:!PSK:!SRP:!SSLv:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA'; | ||
| ssl_prefer_server_ciphers on; | ||
|
|
||
| location / { | ||
| proxy_set_header Host $host; | ||
| proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
| proxy_set_header X-Forwarded-Proto https; | ||
| proxy_redirect off; | ||
| proxy_pass http://localhost:3000; | ||
| http2_push_preload on; | ||
| } | ||
|
|
||
| # location / { | ||
| # root html; | ||
| # index index.html index.htm; | ||
| # } | ||
| } | ||
| include servers/*; | ||
| } |
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
👍