From: ara.t.howard@... Date: 2006-05-23T02:16:35+09:00 Subject: Re: Zed and Luis drop the bomb on Ruby's poor performance On Tue, 23 May 2006, Victor Shepelev wrote: > Makes sense. But. > I'd like to think about things like "reasonable slow" and "unreasonable > slow"; and Ruby sometimes is just __unreasonable__ slow. Here are some > examples: > > * I'm working with custom UI library, which is based on HTML (namely, on > terrainformatica.com/htmlayout). There are a large amount of objects created > corresponding to DOM tree nodes ("large" means thousands) and profiler says, > that one of the slowest operation is Class#new - is it normal? devil's advocate: yes it makes sense that 'new' is slow. it's generally slow in all langs, including c++ (where stl insertion causes 3 of ctors and the profiler will show this) and perl, which is claimed faster than ruby but, when objects are used, crawls compared to ruby because object creation is so bad in it. the fact that object creation is so slow is why people historically don't represent chars as objects in text editors. that said, perhaps it can be sped up - at least this is a good, concrete example! > * 5000 objects is loaded from database (by SELECT'ing and setting fields). > The major slower is that each object has Date field (Integer#gcd is very > slow). Or Kernel#send (I use it because of my DSL created) and so on. probably this could be sped up too - but your point is taken. > Summarizing, after large profilings and optimizations, there are oftenly > some core methods (even Fixnum#+) show themselves as major speed problems. > > This situation I call "unreasonable slow". i like where you are going with this - let's see if a critical analysis of some 'real' issues sheds light on whether they point to the need for a vm (my feelings are that it will not, but i'd be happy to be proven wrong). i can't think of a better way than to post some specific code and see what people can do with it. history has shown that posting such challenges to the list yields at least an order of magnitude speed-up, if it doesn't i'd say you are correct - anyone have an example less than 100 lines or so we can play with? without an example i'm afraid this discussion will be little more than hot air. let's get something real to work with, prove that it is 'unreasonably' slow, and then discuss. kind regards. -a -- be kind whenever possible... it is always possible. - h.h. the 14th dali lama