Showing posts with label ruby. Show all posts
Showing posts with label ruby. Show all posts

Saturday, 1 December 2007

Brilliant: Autotest Rails with iNotify

Great post at Alban's blog about how to use inotify with Rails Autotest.  Much faster test responses.
del.icio.us Tags: , , , , , ,

Monday, 1 October 2007

Ruby httpclient library bug

Running into a problem with httpclient? - this link

del.icio.us Tags: , ,

may explain the problem.

Thursday, 21 June 2007

Rails, queues and clusters

I've been looking at Ruby Queues (rq) to implement a job submission architecture.  It's a good system, with lots of development.  Version 3 came out a couple of months ago.

However, it requires NFS shared disks.  This is a bit tricky across disparate networks.  Would it work with sshfs?  I don't know.  Probably....

However, I'm going to look at Rake.  Multiple threads of work, and then I should be able to kick off remote jobs with Ruby-SSH.  Let's see.

Monday, 18 June 2007

Postgresql COPY/CSV import is fast

Wow.  I've been using a quick Ruby script with ActiveRecord to insert some complex data into a PostgreSQL database.

For a million rows, it was taking an hour plus.  I have almost 100 million rows to insert, so this wasn't the solution.

Changing tack to using PostgreSQL's CSV import function was much faster. 1 million rows were inserted in a few seconds. (NB this is running in VMWare on a slow laptop).

Friday, 27 April 2007

Why's online Ruby (and palindromes)

I've pointed people there in the past, but I haven't actually used Why's try-out-ruby site before.

I don't know how he does it (using his sandbox perhaps?) but it's great.

Try:
10.times do |x| puts x ; end

or

"a man a plan a canal panama".reverse
(There's even a whole page dedicated to this palindrome here.

Slideshare

Slideshare is an interesting idea. Here's a slide showing answers to criticisms of Ruby: http://www.slideshare.net/vishnu/the-top-10-reasons-the-ruby-programming-language-sucks/

But it's SO slow! Not Ruby- but the fetch every single click to Amazon's s3 data service to get the next page. I'd like to see the rest of the slides, but I just don't have time to wait a couple of seconds+ for every single slide.

Saturday, 21 April 2007

Profiling Ruby on Rails performance

This is brilliant- a simple way to profile an individual page in RoR- profiler.

While it won't replace full profiling, it's a good way to see the initial view.