carllerche

carllerche

13p

3 comments posted · 2 followers · following 0

15 years ago @ Union Station - 5 Ways to Speed Up You... · 0 replies · +2 points

@Ilya The main point of that tip is to avoid creating unnecessary objects because the garbage collection phase is slow. I did not mention object allocation.

@Jeremy You are correct, I will update the example. Thanks.

15 years ago @ Union Station - 5 Ways to Speed Up You... · 0 replies · +1 points

@ Zach, @charlieok RE: queuing in rails 3: It has become apparent that queuing has become a standard operation of the modern web application. Whether it is simply queuing an email notification to sent or managing complex daemons, it only makes sense to abstract the concept.

We are working on this problem and the goal is to ship a working system with Ruby on Rails 3.0. If you have any feedback, please feel free to email us or post a ticket on lighthouse (<a href="https://rails.lighthouseapp.com" target="_blank">https://rails.lighthouseapp.com -- we are checking it every day).

15 years ago @ Union Station - 5 Ways to Speed Up You... · 0 replies · +3 points

My point with the introduction is that when writing Ruby, the vast majority of an actual ruby application (discounting network operation) is not spent in the actual language (method dispatching) but in data structure manipulation (String, Hash, etc... methods). The fact that ruby makes it so easy to chain these operations and abundantly use features offered by these data structures is usually what slows down your average app. If one were to write an app in ruby using C idioms (initialize Arrays to the correct length, do offset arithmetic, ...) vs. the same app using ruby idioms (my_arr.map.flatten.compact), and the first version will most likely be quite a significant amount faster.