Skip to content

Conversation

@jhawthorn
Copy link
Collaborator

@jhawthorn jhawthorn commented Jan 31, 2025

Inspired by @byroot's work in #139

This moves the responsibility for establishing the initial TCP or unix socket connection to Ruby. This allows us to lean on Ruby's implementation and configuration of DNS timeouts as well as happy eyeballs/fast fallback.

In addition to improved timeouts, this should also deliver more detailed and specific error messages.

Before

❯ be ruby connect_benchmark.rb
Warming up --------------------------------------
trilogy connect/close
                       761.000  i/100ms
Calculating -------------------------------------
trilogy connect/close
                          8.238k (± 2.5%) i/s -     41.855k in   5.083964s

After

Warming up --------------------------------------
trilogy connect/close
                       777.000  i/100ms
Calculating -------------------------------------
trilogy connect/close
                          8.169k (± 3.6%) i/s -     41.181k in   5.047361s

Doesn't seem to be a significant performance difference

@jhawthorn jhawthorn mentioned this pull request Feb 5, 2025
This moves the responsability for establishing the initial TCP or unix
socket connection to Ruby. This allows us to lean on Ruby's
implementation and configuration of DNS timeouts as well as happy
eyeballs/fast fallback.

In addition to improved timeouts, this should also deliver more detailed
and specific error messages.

Co-authored-by: Adam Hess <[email protected]>
Co-authored-by: Jean Boussier <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants