Skip to content

Instantly share code, notes, and snippets.

View tmcw's full-sized avatar
💭
merging your prs

Tom MacWright tmcw

💭
merging your prs
View GitHub Profile
@tmcw
tmcw / optimization.md
Last active February 14, 2021 14:38
Optimization

Optimization

Correctly prioritizing and targeting performance problems and optimization opportunities is one of the hardest things to master in programming. There are a lot of ways to do it wrong: by prematurely optimizing non-bottlenecks, or preferring fast solutions to clear solutions, or measuring problems incorrectly.

I'll try to summarize what I've learned about doing this right.

First, don't optimize until there's an issue. And issues should be defined as application issues: performance problems that are either detectable by the users (lag) or endanger the platform – i.e. problems that cause downtime, like out-of-memory issues. Until there's an issue, don't think about peformance at all: just solve the problem at hand, which is "creating value for the end-user," or some less-corporate translation of the same.

Second, only optimize with instruments. By instruments, I mean technology that lets you decipher which sub-part of the stack is the bottleneck. Let's say you see slowness around fet

DATE SP500
2009-10-26 1066.95
2009-10-27 1063.41
2009-10-28 1042.63
2009-10-29 1066.11
2009-10-30 1036.19
2009-11-02 1042.88
2009-11-03 1045.41
2009-11-04 1046.50
2009-11-05 1066.63
@tmcw
tmcw / .vimrc
Created October 15, 2019 16:33
call plug#begin('~/.vim/plugged')
Plug 'justinmk/vim-dirvish'
Plug 'tpope/vim-vinegar'
Plug 'ElmCast/elm-vim'
" Git
Plug 'tpope/vim-rhubarb'
Plug 'tpope/vim-fugitive'
(-------------List output---------- )
341 55
342 55
343 55
344 55
340 56
347 56
338 57
336 58
337 58
(-------------List output---------- )
341 55
342 55
343 55
344 55
340 56
347 56
338 57
336 58
337 58
(-------------List output---------- )
341 55
342 55
343 55
344 55
340 56
347 56
338 57
336 58
337 58
(-------------List output---------- )
341 55
342 55
343 55
344 55
340 56
347 56
338 57
336 58
337 58
(-------------List output---------- )
341 55
342 55
343 55
344 55
340 56
347 56
338 57
336 58
337 58
(-------------List output---------- )
341 55
342 55
343 55
344 55
340 56
347 56
338 57
336 58
337 58
(-------------List output---------- )
341 55
342 55
343 55
344 55
340 56
347 56
338 57
336 58
337 58