Ruby Speed - install from apt-get or compile yourself?

Hey Wolfgang,

I think the biggest slow-down is when we parse BLAST results and insert hyperlinks to be able to download sequences, i.e, format_blast_results function and those that it calls. Effectively this requires doing regular-expression text searches on each line BLAST outputs. Several thoughts:

  1. Having fewer results can make a huge speedup (e.g. using an evalue cutoff or max number of reported alignmeents) but obviously users need to be educated appropriately for this kind of thing.
  2. Whenever we do a replacement, we also write to the log file [a]. If you change the logging level to a more stringent level (or comment out those “log” lines), you would probably get a small speedup.
  3. Stackoverflow suggests [b] that scanning for BLAST output lines that need changing could be accelered as much as 50% (e.g., [c]), especially with newer ruby versions.

Feel free to re-implement & test and submit a pull request :slight_smile:


[a]: e.g., lib/sequenceserver.rb line 596
[c]: lib/sequenceserver.rb line 421: if line.match(/^>/) #

I did a test on a non-production system, and sequence server seemed SUPER fast when I used a self-compiled Ruby 2.1. I’m encouraged enough to try this out on my production machine, but - quick question: when I install Ruby 2.1 what will I then have to do to get sequenceserver to run on that instead of an older Ruby?

Super. I had seen figures online claiming 60-70% performance
improvement on Ruby 2.x over 1.9.3.

To use Ruby 2.1:
1. Uninstall the older ruby,
2. Make sure 2.1 gets precedence in PATH environment variable
3. I use chruby (

$ gem install sequenceserve
$ sequenceserver

You will have to ensure correct ruby in your init script too. With
chruby, you would do:

chruby-exec 2.1 -- sequenceserver

That will execute SS on Ruby 2.1. Test it on the CLI once before
editing your init script.

To see available Rubies:

$ chruby

-- Priyam