Sign In

Alexis Bernard

Ruby on Rails Developer at Base Secrète

Alexis Bernard is a Ruby on Rails Developer currently working at Base Secrete in the Geneva Area, Switzerland.1 He has been in this role since February 2013, accumulating over 11 years and 9 months of experience as of October 2024.1

Prior to his current position, Alexis worked at official.fm, where he held the position of Chief Technical Officer.1 This background suggests he has extensive experience in web development and technical leadership.

Alexis is active on LinkedIn, where he occasionally shares insights related to his field. For instance, on October 11, 2024, he made a post discussing the concept that "Maybe later is faster than surely now," which likely relates to development practices or project management in software engineering.2

As a Ruby on Rails Developer, Alexis specializes in using the Ruby programming language and the Rails web application framework. This technology stack is popular for building robust and scalable web applications, indicating that Alexis likely has strong skills in back-end development, database management, and web application architecture.

Given his long tenure at Base Secrete and his previous role as a CTO, it's reasonable to infer that Alexis has a wealth of experience in the tech industry and likely plays a significant role in his current company's technical operations and decision-making processes.

Highlights

Aug 23 · linkedin

Array#find does not scale

Because scanning sequentially becomes linearly slower as the array grows. But looking for data through an ordered array is extremely fast!

Indeed, it allows to search via dichotomy. At each step it splits the array in half, then splits in half again and so on. It avoids scanning sequentially all entries. The complexity is less: O(log(n)) instead of O(n).

It's much faster. It's like an index. It's possible because data are sorted.

We are lucky because Ruby provides Array#bsearch. Let's compare it with Array#find against 1 million entries from 1 to 1_000_000.

123_456 is a little after the beginning of the array and 654_321 is a little after the half. To be fair we will look for both values and see the difference at the end.

See code in 1st image.

Bsearch is always a lot faster. It's impossible to tell of how much, because it depends of the size of the array and where is the data. Do not forget that the array must be sorted and the condition cannot change.

Moreover the execution time of bsearch does not vary too much. Whereas for Array#find(654321) is a lot slower than Array#find(123456) because the former is further in the array. That is why, Array#find does not scale 😉

Looking through an array of numbers is not real use case. Let's see how we can create an index for real data. Note that, as a database index, it's relevant only if you have more reads than writes.

See code in 2nd image.

#rubyonrails #highspeedror

Jun 17 · linkedin

Measuring Ruby Garbage Collector

The Garbage Collector releases memory slots from unused objects. However, it interrupts the Ruby execution and might significantly increase requests' response time. Would you like to know how the GC slows down your app?

Related Questions

What projects has Alexis Bernard worked on at Base Secrete?
What are some notable achievements of Alexis Bernard in his career?
How did Alexis Bernard transition into Ruby on Rails development?
What skills does Alexis Bernard specialize in?
What is Alexis Bernard's educational background?
Alexis Bernard
Alexis Bernard, photo 1
Alexis Bernard, photo 2
Add to my network

Location

Geneva, Geneva, Switzerland