Forked from victor-homyakov/links - code optimization techniques.md
Created
April 25, 2021 18:58
-
-
Save Barto-dev/dbd1de1dd4a77936862a247ed46bd485 to your computer and use it in GitHub Desktop.
Revisions
-
victor-homyakov revised this gist
Apr 10, 2021 . 1 changed file with 2 additions and 4 deletions.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 charactersOriginal file line number Diff line number Diff line change @@ -46,12 +46,10 @@ - Код: https://github.com/apache/logging-log4j2/blob/master/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/AbstractOutputStreamAppender.java#L164 ## Специфичные для JavaScript - Ленивая инициализация тяжёлого кода: https://philipwalton.com/articles/idle-until-urgent/ - Сравнение скорости ES6 и ES5 в браузерах и Node.js: https://victor-homyakov.github.io/six-speed/ - Бенчмарк деструктурирования `useState()`: https://jsbench.me/5wkmyktgk2/1 - ConsString в V8: https://github.com/v8/v8/blob/5a2c53f9482e19d150303cd36d7ba04418e6cade/src/objects/string.tq#L37 - Мономорфизм в V8: https://habr.com/ru/post/303542/ - Разработчики Chromium анализируют производительность ES2015+: https://docs.google.com/document/d/1EA9EbfnydAmmU_lM8R_uEMQ-U_v4l9zulePSBkeYWmY - Тонкости реализации некоторых фич JS в V8: https://github.com/v8/v8/tree/ce85e66a20813f2714b8cd7b09ce98035f3fcb53/src/builtins -
victor-homyakov revised this gist
Apr 9, 2021 . 1 changed file with 1 addition and 1 deletion.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 charactersOriginal file line number Diff line number Diff line change @@ -52,6 +52,6 @@ - Бенчмарк деструктурирования `useState()`: https://jsbench.me/5wkmyktgk2/1 ## Специфичные для V8 - Мономорфизм: https://habr.com/ru/post/303542/ - Разработчики Chromium анализируют производительность ES2015+: https://docs.google.com/document/d/1EA9EbfnydAmmU_lM8R_uEMQ-U_v4l9zulePSBkeYWmY - Тонкости реализации некоторых фич JS в V8: https://github.com/v8/v8/tree/ce85e66a20813f2714b8cd7b09ce98035f3fcb53/src/builtins -
victor-homyakov revised this gist
Apr 9, 2021 . 1 changed file with 2 additions and 0 deletions.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 charactersOriginal file line number Diff line number Diff line change @@ -21,6 +21,8 @@ - Ленивые вычисления в библиотеках: - Lodash: https://lodash.com/docs/4.17.15#lodash - Immutable: https://immutable-js.github.io/immutable-js/docs/#/Seq - Трансдьюсеры в Ramda, RxJS, transducers-js: - https://medium.com/javascript-scene/transducers-efficient-data-processing-pipelines-in-javascript-7985330fe73d - Copy-on-write в библиотеках: - Immer: https://immerjs.github.io/immer/produce - Immutable: https://immutable-js.github.io/immutable-js/docs/#/updateIn -
victor-homyakov revised this gist
Apr 9, 2021 . 1 changed file with 1 addition and 0 deletions.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 charactersOriginal file line number Diff line number Diff line change @@ -14,6 +14,7 @@ - Бенчмарк добавления и поиска в Array и Set: https://jsfiddle.net/p5zhfqa4/2/ - `_.transform` - аналог `reduce` с досрочным выходом: https://lodash.com/docs/4.17.15#transform - Бенчмарк кубического корня: https://jsbench.me/9tkmz8nds2/1 - Мемоизация: https://github.com/darrylhodgins/typescript-memoize ## Для языков/фреймворков без lazy eval, copy-on-write, etc. - Сравнение ленивых вычислений и нативной реализации в JS: https://jsbench.me/43kgs6ox63/1 -
victor-homyakov revised this gist
Apr 9, 2021 . 1 changed file with 1 addition and 1 deletion.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 charactersOriginal file line number Diff line number Diff line change @@ -16,7 +16,7 @@ - Бенчмарк кубического корня: https://jsbench.me/9tkmz8nds2/1 ## Для языков/фреймворков без lazy eval, copy-on-write, etc. - Сравнение ленивых вычислений и нативной реализации в JS: https://jsbench.me/43kgs6ox63/1 - Ленивые вычисления в библиотеках: - Lodash: https://lodash.com/docs/4.17.15#lodash - Immutable: https://immutable-js.github.io/immutable-js/docs/#/Seq -
victor-homyakov revised this gist
Apr 9, 2021 . 1 changed file with 2 additions and 2 deletions.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 charactersOriginal file line number Diff line number Diff line change @@ -8,8 +8,8 @@ ## Не зависящие от языка и его реализации - Rosetta Code - реализации задач на разных языках: http://rosettacode.org/wiki/Collections - Статьи по основным структурам данных: - Структуры данных с примерами на JS: https://habr.com/ru/post/310794/ - Выбор структур данных: https://habr.com/ru/post/339656/ - 10 типов структур данных, которые нужно знать + видео и упражнения: https://habr.com/ru/company/netologyru/blog/334914/ - Бенчмарк добавления и поиска в Array и Set: https://jsfiddle.net/p5zhfqa4/2/ - `_.transform` - аналог `reduce` с досрочным выходом: https://lodash.com/docs/4.17.15#transform -
victor-homyakov revised this gist
Apr 9, 2021 . 1 changed file with 2 additions and 2 deletions.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 charactersOriginal file line number Diff line number Diff line change @@ -1,8 +1,8 @@ # Приёмы оптимизации кода по скорости ## Организационные - Культура разработки performance-first: https://tonsky.me/blog/performance-first/ - Бюджет скорости: https://wp-rocket.me/blog/performance-budgets/ - Performance mantra: http://www.brendangregg.com/blog/2018-06-30/benchmarking-checklist.html ## Не зависящие от языка и его реализации -
victor-homyakov created this gist
Apr 9, 2021 .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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,54 @@ # Приёмы оптимизации кода по скорости ## Организационные - О культуре разработки performance-first: https://tonsky.me/blog/performance-first/ - О бюджете скорости: https://wp-rocket.me/blog/performance-budgets/ - Performance mantra: http://www.brendangregg.com/blog/2018-06-30/benchmarking-checklist.html ## Не зависящие от языка и его реализации - Rosetta Code - реализации задач на разных языках: http://rosettacode.org/wiki/Collections - Статьи по основным структурам данных: - Структуры данных для самых маленьких с примерами на JS: https://habr.com/ru/post/310794/ - О выборе структур данных: https://habr.com/ru/post/339656/ - 10 типов структур данных, которые нужно знать + видео и упражнения: https://habr.com/ru/company/netologyru/blog/334914/ - Бенчмарк добавления и поиска в Array и Set: https://jsfiddle.net/p5zhfqa4/2/ - `_.transform` - аналог `reduce` с досрочным выходом: https://lodash.com/docs/4.17.15#transform - Бенчмарк кубического корня: https://jsbench.me/9tkmz8nds2/1 ## Для языков/фреймворков без lazy eval, copy-on-write, etc. - Сравнение ленивых вычислений с нативной реализацией: https://jsbench.me/43kgs6ox63/1 - Ленивые вычисления в библиотеках: - Lodash: https://lodash.com/docs/4.17.15#lodash - Immutable: https://immutable-js.github.io/immutable-js/docs/#/Seq - Copy-on-write в библиотеках: - Immer: https://immerjs.github.io/immer/produce - Immutable: https://immutable-js.github.io/immutable-js/docs/#/updateIn - Ramda: https://ramdajs.com/docs/#lens - Использование линз Ramda в редьюсерах: https://levelup.gitconnected.com/simplify-redux-reducers-with-lenses-8ec6b2de3ae2 ## Зависящие от железа - Бенчмарк branch prediction: https://jsfiddle.net/0r6y5e7L/ - Скорость прямого и обратного направления чтения памяти при хэшировании строк: - Issue на GitHub: https://github.com/darkskyapp/string-hash/issues/12 - Бенчмарк для браузеров: https://jsperf.com/string-hash-speed - Бенчмарк для Node.js: https://gist.github.com/victor-homyakov/bcb7d7911e4a388b1c810f8c3ce17bcf - Разница в скорости доступа к массиву по строкам и столбцам: https://jsfiddle.net/3smxuh1o/ ## Для языков со сборкой мусора - Fly-weight объект в ExtJS: https://docs.sencha.com/extjs/6.2.0/modern/Ext.html#method-fly - Нулевое потребление памяти в клиенте statsd: https://github.com/smira/go-statsd/blob/master/README.md#zero-memory-allocation - Нулевое и околонулевое потребление памяти в log4j: - Описание: https://logging.apache.org/log4j/2.x/manual/garbagefree.html - Один из пулл-реквестов со снижением потребления памяти: https://github.com/apache/logging-log4j2/pull/251 - Код: https://github.com/apache/logging-log4j2/blob/master/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/AbstractOutputStreamAppender.java#L164 ## Специфичные для JavaScript - ConsString в V8: https://github.com/v8/v8/blob/5a2c53f9482e19d150303cd36d7ba04418e6cade/src/objects/string.tq#L37 - Ленивая инициализация тяжёлого кода: https://philipwalton.com/articles/idle-until-urgent/ - Сравнение скорости ES6 и ES5 в браузерах и Node.js: https://victor-homyakov.github.io/six-speed/ - Бенчмарк деструктурирования `useState()`: https://jsbench.me/5wkmyktgk2/1 ## Специфичные для V8 - О мономорфизме: https://habr.com/ru/post/303542/ - Разработчики Chromium анализируют производительность ES2015+: https://docs.google.com/document/d/1EA9EbfnydAmmU_lM8R_uEMQ-U_v4l9zulePSBkeYWmY - Тонкости реализации некоторых фич JS в V8: https://github.com/v8/v8/tree/ce85e66a20813f2714b8cd7b09ce98035f3fcb53/src/builtins