From mboxrd@z Thu Jan 1 00:00:00 1970 From: rlane@club.cc.cmu.edu (Rich Lane) Date: Tue, 25 Aug 2009 21:50:48 -0400 Subject: [sup-talk] [PATCH] add xapian-specific hack to quickly create a Person In-Reply-To: <1251156216-sup-5563@masanjin.net> References: <1250965695-31073-1-git-send-email-rlane@club.cc.cmu.edu> <1250967263-31292-1-git-send-email-rlane@club.cc.cmu.edu> <1251156216-sup-5563@masanjin.net> Message-ID: <1251250991-sup-3593@zyrg.net> Excerpts from William Morgan's message of Mon Aug 24 19:24:19 -0400 2009: > Reformatted excerpts from Rich Lane's message of 2009-08-22: > > - mk_person = lambda { |x| Person.new(*x.reverse!) } > > + mk_person = lambda { |x| QuickPerson.new(*x) } > > What about lambda { |x| Person.new x[1], x[0] }. Surely that must be > even faster? The slow part is the processing in Person#initialize, which QuickPerson overrides. You might also be able to avoid that by moving the initialize() code into Person.from_address.