[ANN] net-wrong - experimental Ruby 1.9.3+ net/* monkey patch
- Eric Wong
- 2011-12-15 @ 00:07
The goal of this project is to obsolete itself and improve Ruby itself.
This RubyGem /may/ improve the performance of net/* libraries under
(matz) Ruby 1.9.3+. If there is any benefit, large (memory-footprint)
applications stand more to gain than smaller ones.
* Avoids expensive exceptions in Net::BufferedIO#rbuf_fill
* Avoids temporary classes which invalidate VM caches on GC
* Avoids (some) GC thrashing by reusing a temporary buffer
* Won't improve performance if using SSL connections
* Only net/http and net/smtp are tested for now.
== Things To Avoid When Using This
* Avoid using Timeout.timeout at all (always :P).
* Avoid using temporary Class objects on your own, this causes internal
VM caches to be invalidated when Classes are garbage-collected
* Avoid using Timeout.timeout without an explicit exception class,
Timeout.timeout will generate a temporary Classes.
* Avoid defining/redefining methods/constants once your application is
running, you'll have temporary singleton Classes this way.
This is only supported on mainline Ruby 1.9.3+ on Unix-like systems.
* gem install net-wrong
This depends on the following gems (which RubyGems should take care of):
* kgio - http://bogomips.org/kgio/
* terrible_timeout - http://bogomips.org/terrible_timeout/
All you need to do is require the appropriate module and continue
using your existing Net::* code as usual. For Net::HTTP users,
If you're using Net::SMTP:
...And similar for the (untested) net/wrong/telnet and net/wrong/pop
* git clone git://bogomips.org/net-wrong
Email patches (git format-patch + git send-email) or pull requests
(git request-pull) to the public list <email@example.com>
and/or Eric Wong <firstname.lastname@example.org>
If you like web browsers, you can also view the source with a web browser:
* net-http-persistent - manages persistent connections for Net::HTTP
This reduces the use of terrible_timeout.
Feedback (results, bug reports, patches, pull-requests) is very much
For issues/bugs/patches/pull-requests/improvements specific to this package
itself, email the mailing list email@example.com or
Eric Wong <firstname.lastname@example.org>. Please send plain-text mail, HTML
will not be read.
There is an open ticket for improving things in the Ruby issue tracker:
https://bugs.ruby-lang.org/issues/5138 (forwards to email@example.com)