From cedf4302a72127b04df8bef2e0e6b52585091a31 Mon Sep 17 00:00:00 2001 From: Raphael Date: Sat, 27 Nov 2010 17:43:07 -0500 Subject: [PATCH] real_name takes time --- app/models/person.rb | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/app/models/person.rb b/app/models/person.rb index 9a9fda03b..114250a51 100644 --- a/app/models/person.rb +++ b/app/models/person.rb @@ -68,11 +68,16 @@ class Person end def real_name - if profile.first_name.nil? || profile.first_name.empty? - self.diaspora_handle - else - "#{profile.first_name.to_s} #{profile.last_name.to_s}" + result = nil + time = Benchmark.realtime do + result = if profile.first_name.nil? || profile.first_name.empty? + self.diaspora_handle + else + "#{profile.first_name.to_s} #{profile.last_name.to_s}" + end end + Rails.logger.info "event=real_name ms=#{time}" + result end def owns?(post)