
Taking a sabbatical to work on Ruby profiling tools - bkudria
https://jvns.ca/blog/2017/12/02/taking-a-sabbatical-to-work-on-ruby-profiling-tools/
======
SOLAR_FIELDS
Sabbaticals should be more condoned in the workforce. I suspect we may see
less turnover in many areas of software engineering if this was an option
after say a 3 or 4 year tenure at some company.

~~~
kelnos
Absolutely agree. And if they are unpaid, and the employee can schedule them
around projects finishing (or at least in places where multiple people are
responsible for them so that the loss of one person isn't a big deal), there's
really minimal cost to the company, but a potentially large upside.

~~~
ksec
May be even better if the unpaid sabbatical was a holiday, and paid ( or at
least support ) if the period was used to contribute to open source?

~~~
runeb
If the unpaid sabbatical were a paid holiday it would be regular paid work?

------
jvns
I'm working on surveying existing Ruby & Python profiling tools so that I
understand what's been tried already.

If anyone has tools/techniques I've missed, I'd love additions to this list:

[https://gist.github.com/jvns/b81eb039f6373bc577d7dbdd978581b...](https://gist.github.com/jvns/b81eb039f6373bc577d7dbdd978581b5)

~~~
masklinn
[https://github.com/evanhempel/python-
flamegraph](https://github.com/evanhempel/python-flamegraph) is similar to
pyflame but does its sampling at the Python level, that makes it somewhat
costlier & less precise _but_ it's not restricted to Linux.

------
mooreds
I think sabbaticals are great. If you can, save up and do them yourself. Or,
if you are switching jobs and have savings, ask for a month or two between the
end date of your current job and the start date of the new job. It's a heck of
a lot easier to spend money when you know you have a new job coming up.

What to do? Something technical is great. Non tech stuff is good too (travel,
learning new skills, family time, volunteering, etc).

OT: HN folks, I posted this a few days ago, not sure if there was an issue
with dup checking:
[https://news.ycombinator.com/item?id=15832094](https://news.ycombinator.com/item?id=15832094)

~~~
dang
On HN a story doesn't count as a dupe unless it has had significant attention.
Until then, a small number of reposts is ok:
[https://news.ycombinator.com/newsfaq.html](https://news.ycombinator.com/newsfaq.html).
This is one way we try to mitigate the randomness of what gets noticed.

------
pageald
>I’ll be on sabbatical from my job. . . and working on building better
profiling tools for Ruby (and maybe Python??).

I can't comment on Ruby's profiling stack, but I think that cProfile is a
great tool for finding bottlenecks in Python. Usually, I've found that sorting
functions by cumulative execution time is sufficient. You can't do flame
graphs out-of-the-box, however.

~~~
masklinn
> I can't comment on Ruby's profiling stack, but I think that cProfile is a
> great tool for finding bottlenecks in Python.

Whereas I don't. Between the performance impact (code with and without
cprofile can have very different… profile), the lack of stack information and
yet the lack of precise, actionable code-level information makes it not really
useful/convenient for non-trivial codebases. Feeding the trace files to more
visual systems (e.g. gprof2dot or runsnakerun) doesn't help much either.

These days I tend to use python-flamegraph (or pyflame but that's linux-only,
though it has the advantage of using ptrace and can be attached to a running
process at any point), this gives a mile-high view of the entire software in
an extremely readable format, and from there it's possible to dive into
specific hotspots with limited-scope profiles (whether with cprofile, with
line_profiler[0] or with dedicated benchmarks).

[0] which has cprofile's issue of impacting the software it observes except
significantly worse)

~~~
barrkel
General rule I have: sampling profilers for CPU performance, instrumenting
profilers for memory and other uses, like analyzing control flow.

------
viraptor
Sadly, Ruby has a great profiling tool already built in: dtrace integration.
It's the Linux side that's lagging in this case.

~~~
Thaxll
dtrace is too low level to be really useful, have a look at Go and Java for
powerful tools.

~~~
viraptor
It does provide high-level (function, exception, etc.) probes as well:
[https://ruby-doc.org/core-2.3.3/doc/dtrace_probes_rdoc.html](https://ruby-
doc.org/core-2.3.3/doc/dtrace_probes_rdoc.html)

Then you can either use existing scripts of build on top of that. It's quite
powerful. What do you think is missing?

------
stanislavb
Good luck, mate. Looking forward to see some decent and helpful tools in the
foreseeable future.

------
BlackjackCF
Oh man. I'm so excited about this. I love all of Julia's work. Would love to
see the fruit of this sabbatical.

------
eric-hu
Good luck Julia! Hope to see some blog posts of your findings along the way.

------
frik
> [https://jvns.ca/blog/2016/06/12/a-weird-system-call-
> process-...](https://jvns.ca/blog/2016/06/12/a-weird-system-call-process-vm-
> readv/)

> does this tool, that can spit out Ruby stack traces quickly for any Ruby
> program with debugging symbols enabled, actually exist somewhere and I just
> don’t know about it?

To your question in your other post you linked in your post: Maybe you mean
APM, it stands for application performance monitoring. Search for "Ruby APM".
Maybe the can inspire you for your tool. Good luck

------
kindfellow92
This “Sabbatical” trend in software companies is really toxic. It’s a
justification that allows companies to burn people out without looking bad. A
sustainable interesting career doesn’t need a break. It’s a subtle admission
that you’re overworked and your work is monotonous, which are both signs of a
poorly managed company.

Sabbaticals are reserved for tenured professors who have been working for a
lifetime so they can achieve something non-academic. It should not become a
euphemism for breaks that burnt out programmers who lack time management
skills take so they can get their life together.

~~~
viraptor
> Sabbaticals are reserved for tenured professors

Why do you think so? Sabbatical means a break. It's common for professors, but
why prevent other people from taking it? I took a sabbatical from my uni to do
some real work (and ended up moving unis, countries as a result), then took a
sabbatical from work for personal reasons and did other things I wanted to do.

If that prevents a burn out for someone, great! Not every company has enough
projects going on to reshuffle you to the place you enjoy. (Or may not want to
for valid reasons) Not every sabbatical is about burnout either.

~~~
dvt
> Why do you think so?

Because... that's what they actually _are_. A sabbatical was a very specific
thing that was hijacked by HR people in tech companies. What you did was _take
a break_ ; that has very different connotations than what a sabbatical is
supposed to be.

~~~
viraptor
This may be a cultural thing, but I've always understood sabbatical as a long
break - nothing explicitly related to academia. Multiple definitions I see on
the internet seem to agree.

~~~
dvt
Well then I suggest you take a look at "The Origin and Early History of
Sabbatical Leave"[1] -- its roots lie _firmly_ in academia. It was re-
appropriated (in probably the last ~10 years) by tech HR departments which are
typically enamored with academia, so that's no surprise.

[1]
[https://www.jstor.org/stable/40222893](https://www.jstor.org/stable/40222893)

~~~
ams6110
I worked in an investment bank in the 1990s and they offered a sabbatical (and
called it that) after 10 years and every 5 years thereafter IIRC. I think it
was 2 months. At least 6 weeks. You had to take it all at once you could not
subdivide it.

