---
title: "RubyKaigi 2018 Day two"
description:
  "Ground report of Day two from Sendai, Japan where RubyKaigi 2018 is happening"
canonical_url: "https://www.bigbinary.com/blog/rubykaigi-2018-day-two"
markdown_url: "https://www.bigbinary.com/blog/rubykaigi-2018-day-two.md"
---

# RubyKaigi 2018 Day two

Ground report of Day two from Sendai, Japan where RubyKaigi 2018 is happening

- Author: Prathamesh Sonpatki
- Published: June 1, 2018
- Categories: Ruby

[RubyKaigi](http://rubykaigi.org/2018) is happening at Sendai, Japan from 31st
May to 2nd June. It is perhaps the only conference where one can find almost all
the core Ruby team members in attendance.

This is [Prathamesh](https://twitter.com/_cha1tanya). I bring you live details
about what is happening at the Kaigi over the next two days. If you are at the
conference please come and say "Hi" to me.

Check out
[what happened on day 1](https://blog.bigbinary.com/2018/05/31/rubykaigi-2018-day-one.html)
.

### Faster Apps, No Memory Thrash: Get Your Memory Config Right by Noah Gibbs

[Noah](https://twitter.com/codefolio) gave an awesome talk on techniques to
manage the memory used by Ruby applications. One of the main point while dealing
with GC is to make it run less, which means don't create too many objects. He
also mentioned that if application permits then destructive operations such as
`gsub!` or `concat` should be used since they save CPU cycles and memory. Ruby
allows setting up environment variables for managing the heap memory but it is
really hard to choose values for these environment variables blindly.

Noah has built a tool which uses `GC.stat` results from applications to estimate
the values of the memory related environment variables. Check out the
[EnvMem](https://github.com/noahgibbs/env_mem) gem.

In the end, he discussed some advanced debugging methods like checking
fragmentation percentage. The formula is prepared by
[Nate Berkopec](https://twitter.com/nateberkopec/).

```ruby
s = GC.stat
used_ratio = s[:heap_live_slots].to_f / (s[:heap_eden_pages] * 408)
fragmentation = 1 - used_ratio
```

We can also use `GC::Profiler` to profile the code in real time to see how GC is
behaving.

Benchmark used for this talk can be found
[here](https://github.com/noahgibbs/rails_ruby_bench). Slides for this talk can
be found
[here](https://docs.google.com/presentation/d/1-WrYwz-QnSI9yeRZfCCgUno-KOMuggiGHlmOETXZy9c/edit?usp=sharing).

### Guild prototype

Next I attended talk by [Koichi Sasada](https://twitter.com/_ko1) on Guild
prototype. He discussed the proposed design spec for Guild with a demo of
Fibonacci number program with 40 core CPU and 40 guilds. One of the interesting
observations is that performance drops as number of guilds increases because of
the global locking.

![Guild performance](https://www.bigbinary.com/blog/images/images_used_in_blog/2018/rubykaigi-2018-day-two/guild.JPG)

He discussed the concept of shareable and non-shareable objects. Shareable
objects can be shared across multiple Guilds whereas non-shareable objects can
only be used one Guild. This also means, you can't make thread unsafe program
with Guilds "by design". He discussed about the challenges in specifying the
shareable objects for Guilds.

Overall, there is still a lot of work left to be done for Guilds to become a
part of Ruby. It includes defining protocols for shareable and non-shareable
objects, making sure GC runs properly in case of Guilds, synchronization between
different Guilds.

The slides for this talk can be found
[here](http://www.atdot.net/~ko1/activities/2018_rubykaigi2018.pdf).

### Ruby programming with type checking

[Soutaro](https://twitter.com/soutaro) from SideCI gave a talk on
[Steep](https://github.com/soutaro/steep), a gradual type checker for Ruby.

In the past, Matz has said that he doesn't like type definitions to be present
in the Ruby code. Steep requires type definitions to be present in separate
files with extension `.rbi`. The Ruby source code needs little amount of
annotations. Steep also has a scaffold generator to generate the basic type
definitions for existing code.

![Steep v/s Sorbet](https://www.bigbinary.com/blog/images/images_used_in_blog/2018/rubykaigi-2018-day-two/steep.JPG)

As of now, Steep runs slower than [Sorbet](https://sorbet.run) which was
discussed yesterday by Stripe team. Soutaro also discussed issues in type
definitions due to meta programming in libraries such as Active Record. That
looks like a challenge for Steep as of now.

### Web console

After the tea break, I attended talk by Genadi on how
[web console](https://github.com/rails/web-console) works.

He discussed the implementation of web-console in detail with references to Ruby
internals related to bindings. He compared the web-console interface with IRB
and pry and explained the difference. As of now, web console has to monkey patch
some of the Rails internals. Genadi has added support for
[registering interceptors](https://github.com/rails/rails/pull/23868) which will
prevent this monkey patching in Rails 6. He is also mentoring a Google summer of
code student to work on Actionable errors project where the user can take
actions like running pending migrations via the webpage itself when the error is
shown.

### Ruby committers v/s the World

![Ruby Committers v/s the World](https://www.bigbinary.com/blog/images/images_used_in_blog/2018/rubykaigi-2018-day-two/committers.JPG)

RubyKaigi offers this unique event where all the Ruby committers come on stage
and face the questions from the audience. This year the format was slightly
different and it was run in the style of the Ruby core developer meeting. The
[agenda](https://docs.google.com/document/u/1/d/1Skh54Fq_nkpycZAS4_03tsafrtABDWxIx2-CKc-QIOY/pub)
was predecided with some questions from the people and some tickets to discuss.
The session started with discussion of
[features coming up in Ruby 2.6](https://www.ruby-lang.org/en/news/2018/05/31/ruby-2-6-0-preview2-released/).

After that, the questions and the tickets in the agenda were discussed. It was
good to see how the Ruby team takes decisions about features and suggestions.

Apart from this, there were
[talks on SciRuby, mRuby, linting, gem upgrades, c extensions and more](http://rubykaigi.org/2018/schedule#jun01)
which I could not attend.

That's all for the day two. Looking forward to the day three already!

Oh and here is the world map of all the attendees from RubyKaigi.

![World map of all attendees](https://www.bigbinary.com/blog/images/images_used_in_blog/2018/rubykaigi-2018-day-two/world.JPG)

## Links

- [Human page](https://www.bigbinary.com/blog/rubykaigi-2018-day-two)
