rush wish list musings

Discussion in 'Ruby' started by Roger Pack, Aug 15, 2008.

  1. Roger Pack

    Roger Pack Guest

    Two things:
    Amen to the lazy part! Ruby in general seem to encourages this weakness
    by allowing me to write code in fewer lines, unfortunately.
    Wow my apologies I didn't know values_at existed [I looked up the docs
    for Array#[] but not that one--my bad]. That was an easy one :) Go

    I don't yet consider this thread useless as it has helped me gain a
    greater understanding of the capabilities of Ruby [I'm somewhat of a
    newbie]. It has also served as useful fodder for a few projects [GC and
    otherwise]. Feel free to disagree, but I like it!

    Roger Pack, Aug 15, 2008
    1. Advertisements

  2. Roger Pack

    Roger Pack Guest

    Question/project wish list:

    Are there any existing projects out there like these:?

    Project to implement MRI generational GC [Boehm or normal].
    Project to improve rails' speed--perhaps by turning certain bottlenecks
    into C or what not.
    An asynchronous Mysql driver project [esp. in C]. I suppose there's
    asymy but...anything else out there?
    A project to optimize the mysql adapter and make it more rails efficient
    [i.e. something like implementing [1]].

    I guess if these projects don't exist if anybody would like start any
    one of them I'd be happy to join and participate. :)

    Take care.
    Roger Pack, Aug 23, 2008
    1. Advertisements

  3. No, that would actually backfire in a big way, I think. Rails being in Ruby
    means that it's portable. It means that when there's a competing, faster VM,
    we can run Rails on it and enjoy a speed boost.

    Rewriting parts in C would make those parts not portable -- very possibly even
    between versions of the mainline Ruby interpreter (many 1.8 extensions don't
    work on 1.9).

    An example: Rails will now run on more than one webserver -- many people run
    it on Mongrel, for example, instead of Webrick. But I seem to remember
    Mongrel not working at all on 1.9, last I tried -- it is, after all, quite a
    lot of C.

    That's OK, because the webserver isn't actually part of Rails, and there are
    webservers that work on 1.9.
    Well, you could make it more efficient in general, but Rails doesn't tend to
    make it easy on the database. (Simple example: Rails never uses prepared
    statements. The conditions look like they do, but Rails actually does string
    interpolation of your placeholders (those ? chars) in Ruby, and then sends
    the whole ginormous SQL query to the database backend, whatever it is.)

    I think, if Ruby's being too slow for you, you might start looking beyond
    Rails. If it's really the database performance, you could start by replacing
    ActiveRecord with a faster, lighter ORM. But actually profile and see if it's
    being slow, first -- as they say, premature optimization is the root of all
    David Masover, Aug 24, 2008
  4. I'm reminded of a horrible movie with an applicable message:

    "If you build it, they will come."

    I bet if there's enough interest, making initial headway on the project
    will be enough to attract contributors. Don't wait for someone else to
    do it.

    Erik Hollensbe, Aug 24, 2008
  5. Roger Pack

    Roger Pack Guest

    Seems like you could get some speedup by inlining Ruby methods:
    ex: [contrived]

    def a
    @a += 1

    def b

    300_000.times { a }
    => .6s
    300_000.times { @a += 1 }
    => .4s

    Anybody know of any projects out there akin to this at all?
    Roger Pack, Aug 27, 2008
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.