by is a library preloader for Ruby designed to speed up process startup. It uses a client/server approach, where the server loads the libraries and li

Search code, repositories, users, issues, pull requests...

submited by
Style Pass
2024-11-07 04:00:03

by is a library preloader for Ruby designed to speed up process startup. It uses a client/server approach, where the server loads the libraries and listens on a UNIX socket, and the client connects to that socket to run a process. For each client connection, the server forks a worker process, which uses the current directory, stdin, stdout, stderr, and environment of the client process. The worker process then processes the arguments provided by the client. The client process waits until the worker process returns an exit code and closes the socket, and uses exit code 0 (normal exit) if the worker process indicates success, or exit code 1 (error) if the worker process indicates an error.

The advantage of using by is that the libraries are already loaded, so Ruby doesn’t have to find the libraries and parse the files in each library on process startup. Here’s a performance comparison:

You can speedup by by making it not require rubygems, since it only needs the socket standard library. The only issue with that is that by is distributed as a gem. There are a few workarounds.

Leave a Comment