From: Brian Candler Date: 2012-08-12T18:46:54+09:00 Subject: Re: The best and complete book ajay paswan wrote in post #1072056: > What is the best and complete book for ruby. > To be specific I want to learn the following things apart from > understanding the language: > 1. thread handling. > 2. Code efficiency, i.e. the time-cost of each instruction. I would agree with Pickaxe, a.k.a. Programming Ruby - 2nd edition if you are using 1.8, 3rd edition if you are using 1.9. The 1st edition is online for free: http://ruby-doc.org/docs/ProgrammingRuby/ As for "the time-cost of each instruction" you're not going to get much help from any book. You need to profile your code - e.g. using the Benchmark library or ruby-prof; identify where the hot-spots are, and then optimise. Ruby is a dynamic language and it all boils down to method dispatch. e.g. a + b is exactly the same as a.+(b), or a.send(:+, b) If you have a hotspot which you can't improve using Ruby, then you can always rewrite that part in C using the RubyInline gem. -- Posted via http://www.ruby-forum.com/.