my talk at linux piter 2016
TRANSCRIPT
On performance analyzing again:Gathering and visualizing flamegraphs in
realtime in Linux environment
Alex Chistyakov, DataArt
Linux Piter 2016, Russia, SPb.
Alex Chistyakov, DataArt Gathering and visualizing flamegraphs in realtime 1 / 51
Who I am (very quickly)
Alex Chistyakov, DataArt Gathering and visualizing flamegraphs in realtime 2 / 51
• Senior SW Developer @ DataArt
• More than 18 years of professional experience
• Researcher @ ISST Lab, ITMO
• Used to be a DevOps Engineer and still probably am
• Can’t quit making presentations w/lots of bullets (that’sterrible, I know)
Performance optimization is not that hard
Alex Chistyakov, DataArt Gathering and visualizing flamegraphs in realtime 3 / 51
Ever heard of a ’comfort zone’?
Alex Chistyakov, DataArt Gathering and visualizing flamegraphs in realtime 4 / 51
• It’s crucial to be out of it to learn something new
Ever heard of a ’comfort zone’?
Alex Chistyakov, DataArt Gathering and visualizing flamegraphs in realtime 5 / 51
• It’s crucial to be out of it to learn something new
• So I made this presentation in TeX
Ever heard of a ’comfort zone’?
Alex Chistyakov, DataArt Gathering and visualizing flamegraphs in realtime 6 / 51
• It’s crucial to be out of it to learn something new
• So I made this presentation in TeX
• With lots of bullets, you know
Ever heard of a ’comfort zone’?
Alex Chistyakov, DataArt Gathering and visualizing flamegraphs in realtime 7 / 51
• It’s crucial to be out of it to learn something new
• So I made this presentation in TeX
• With lots of bullets, you know
• Because I’m not ready yet to leave my comfort zoneentirely
Ever heard of a ’comfort zone’?
Alex Chistyakov, DataArt Gathering and visualizing flamegraphs in realtime 8 / 51
• It’s crucial to be out of it to learn something new
• So I made this presentation in TeX
• With lots of bullets, you know
• Because I’m not ready yet to leave my comfort zoneentirely
• Damn, TeX seems to be my new comfort zone ;(
Okay, flashback to LP 2015 (w/no bullets)
Alex Chistyakov, DataArt Gathering and visualizing flamegraphs in realtime 9 / 51
Fast-forward to 2016
Alex Chistyakov, DataArt Gathering and visualizing flamegraphs in realtime 10 / 51
Brendan Gregg declared Linux DTrace-complete!
A great step forward for mankind...
Alex Chistyakov, DataArt Gathering and visualizing flamegraphs in realtime 11 / 51
...but I’m a cat
So, what is this all about?
Alex Chistyakov, DataArt Gathering and visualizing flamegraphs in realtime 12 / 51
• Modern GNU/Linux
So, what is this all about?
Alex Chistyakov, DataArt Gathering and visualizing flamegraphs in realtime 13 / 51
• Modern GNU/Linux
• A web application
So, what is this all about?
Alex Chistyakov, DataArt Gathering and visualizing flamegraphs in realtime 14 / 51
• Modern GNU/Linux
• A web application
• Collecting flamegraphs
So, what is this all about?
Alex Chistyakov, DataArt Gathering and visualizing flamegraphs in realtime 15 / 51
• Modern GNU/Linux
• A web application
• Collecting flamegraphs
• Visualizing collected flamegraphs
Okay, but what are these flame... things?
Alex Chistyakov, DataArt Gathering and visualizing flamegraphs in realtime 16 / 51
Did you attend LP 2015?
Doing flamegraphs in 2016 is extremely easy
Alex Chistyakov, DataArt Gathering and visualizing flamegraphs in realtime 17 / 51
A hicker needs good boots
Alex Chistyakov, DataArt Gathering and visualizing flamegraphs in realtime 18 / 51
So, we need a language
Alex Chistyakov, DataArt Gathering and visualizing flamegraphs in realtime 19 / 51
The obvious choice
Alex Chistyakov, DataArt Gathering and visualizing flamegraphs in realtime 20 / 51
Why Lisp?
Alex Chistyakov, DataArt Gathering and visualizing flamegraphs in realtime 21 / 51
• Homoiconicity
Why Lisp?
Alex Chistyakov, DataArt Gathering and visualizing flamegraphs in realtime 22 / 51
• Homoiconicity
• Macros
Why Lisp?
Alex Chistyakov, DataArt Gathering and visualizing flamegraphs in realtime 23 / 51
• Homoiconicity
• Macros
• Immutability (?)
Why Lisp?
Alex Chistyakov, DataArt Gathering and visualizing flamegraphs in realtime 24 / 51
• Homoiconicity
• Macros
• Immutability (?)
• Lambdas
But that was not too democratic, so...
Alex Chistyakov, DataArt Gathering and visualizing flamegraphs in realtime 25 / 51
...what about Golang?
Unfortunately, Golang loses
Alex Chistyakov, DataArt Gathering and visualizing flamegraphs in realtime 26 / 51
• Way too modern (uses design ideas from 1970s while Lispwas born in 1958)
Unfortunately, Golang loses
Alex Chistyakov, DataArt Gathering and visualizing flamegraphs in realtime 27 / 51
• Way too modern (uses design ideas from 1970s while Lispwas born in 1958)
• Not functional enough (as in ’functional programming’)
Unfortunately, Golang loses
Alex Chistyakov, DataArt Gathering and visualizing flamegraphs in realtime 28 / 51
• Way too modern (uses design ideas from 1970s while Lispwas born in 1958)
• Not functional enough (as in ’functional programming’)
• Targets Java 1.2 and PHP 4.x market share (designed forapes not humans)
Runtime matters!
Alex Chistyakov, DataArt Gathering and visualizing flamegraphs in realtime 29 / 51
• Static linking is a must
Runtime matters!
Alex Chistyakov, DataArt Gathering and visualizing flamegraphs in realtime 30 / 51
• Static linking is a must
• Decent GC is a must
Runtime matters!
Alex Chistyakov, DataArt Gathering and visualizing flamegraphs in realtime 31 / 51
• Static linking is a must
• Decent GC is a must
• Resulting files should not be too big
Runtime matters!
Alex Chistyakov, DataArt Gathering and visualizing flamegraphs in realtime 32 / 51
• Static linking is a must
• Decent GC is a must
• Resulting files should not be too big
• Let’s consider measureable things only
So, Lisps then
Alex Chistyakov, DataArt Gathering and visualizing flamegraphs in realtime 33 / 51
• Common Lisp
• Scheme
Common Lisp
Alex Chistyakov, DataArt Gathering and visualizing flamegraphs in realtime 34 / 51
Statically linked file is over 30Mb (Golang does around 8Mb)
Scheme
Alex Chistyakov, DataArt Gathering and visualizing flamegraphs in realtime 35 / 51
Is minimalist by design (way too minimalist I’d say)
So, no boots then?
Alex Chistyakov, DataArt Gathering and visualizing flamegraphs in realtime 36 / 51
Nim to the rescue!
Alex Chistyakov, DataArt Gathering and visualizing flamegraphs in realtime 37 / 51
Nim (formerly Nimrod)
Nim: the good parts
Alex Chistyakov, DataArt Gathering and visualizing flamegraphs in realtime 38 / 51
• Strong typing
Nim: the good parts
Alex Chistyakov, DataArt Gathering and visualizing flamegraphs in realtime 39 / 51
• Strong typing
• Static typing
Nim: the good parts
Alex Chistyakov, DataArt Gathering and visualizing flamegraphs in realtime 40 / 51
• Strong typing
• Static typing
• Homoiconicity
Nim: the good parts
Alex Chistyakov, DataArt Gathering and visualizing flamegraphs in realtime 41 / 51
• Strong typing
• Static typing
• Homoiconicity
• Macro system (hygienic)
Nim: the good parts
Alex Chistyakov, DataArt Gathering and visualizing flamegraphs in realtime 42 / 51
• Strong typing
• Static typing
• Homoiconicity
• Macro system (hygienic)
• Immutability
Nim: the good parts
Alex Chistyakov, DataArt Gathering and visualizing flamegraphs in realtime 43 / 51
• Strong typing
• Static typing
• Homoiconicity
• Macro system (hygienic)
• Immutability
• Templates (generics)
Nim: runtime goodness
Alex Chistyakov, DataArt Gathering and visualizing flamegraphs in realtime 44 / 51
• Uses C as an IR
Nim: runtime goodness
Alex Chistyakov, DataArt Gathering and visualizing flamegraphs in realtime 45 / 51
• Uses C as an IR
• Per thread GC (as in Erlang)
Nim: runtime goodness
Alex Chistyakov, DataArt Gathering and visualizing flamegraphs in realtime 46 / 51
• Uses C as an IR
• Per thread GC (as in Erlang)
• Statically linked files < 1Mb (not stripped)
Project Kaldur
Alex Chistyakov, DataArt Gathering and visualizing flamegraphs in realtime 47 / 51
• Means ’cold’ in Faroese
• Because it’s quite cold now
• https://github.com/alexclear/kaldur
Project Kaldur
Alex Chistyakov, DataArt Gathering and visualizing flamegraphs in realtime 48 / 51
• Is live at http://185.37.61.240:5000
• Has a TODO list on Github
• Has an issues list on Github
Conclusions
Alex Chistyakov, DataArt Gathering and visualizing flamegraphs in realtime 49 / 51
• TeX is great!
• Nim is great too!
• Flamegraphs are great!
• Linux is great!
• Open source projects are great!
Questions, please?
Alex Chistyakov, DataArt Gathering and visualizing flamegraphs in realtime 50 / 51
• Why FP?
• Why Linux?
• ...?
So long, and thanks for all the fish
Alex Chistyakov, DataArt Gathering and visualizing flamegraphs in realtime 51 / 51
• https://telegram.me/lhommequipleure