From: thunk Date: 2010-04-03T23:30:06+09:00 Subject: Re: return number of spaces at the beginning of a line My generalize and filled with Ruby Goodness "WhiteBoard" designed has dropped performance. Dang! I thought it was all my traces... this thing has gone from peaking at 2500 (ru'ids) / sec down to 1800 or so. But it is much more general. I even put in some "channel" logic to cut down on redundancy. (something like Java "with" statement). That's probably not going to make much sense... My suspicion is that the dynamic code around creating singletons must be slow compared to just cloning variables (so to say, end result)? Comments on that? I probably could have used one of those dynamic structures instead of a "root" class. Could all the other methods be removed to tweak things along, would that be the automatic advantage of using structures in the first place? ...but the singletons and all are just so simple/elegant in this thing. I have all kinds of methods to dump/trace now. I am not going to go back! This is a quest now, but I think I will worry about performance after the thing is fully functional. (I remember seeing "CleanSlate" in the "Builder" Gem and that gave me some inspiration on this... did he do that maybe for performance? I assumed until now it was for avoiding conflicts. Does that make sense? if so that might be an easy key to getting the lost performance back.)