Permalink
Browse files

Fix strange NoMemoryError on amd64. Closes #10442 [wrb]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8355 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
jeremy committed Dec 10, 2007
1 parent 836f32c commit f6d45ce95dae13bce93446b678148327edeaf6b8
Showing with 5 additions and 4 deletions.
  1. +5 −4 actionpack/lib/action_controller/benchmarking.rb
@@ -79,15 +79,16 @@ def perform_action_with_benchmark
end
def rendering_runtime(runtime)
- " | Rendering: #{sprintf("%.5f", @rendering_runtime)} (#{sprintf("%d", (@rendering_runtime * 100) / runtime)}%)"
+ percentage = @rendering_runtime * 100 / runtime
+ " | Rendering: %.5f (%d%%)" % [@rendering_runtime, percentage.to_i]
end
def active_record_runtime(runtime)
db_runtime = ActiveRecord::Base.connection.reset_runtime
db_runtime += @db_rt_before_render if @db_rt_before_render
db_runtime += @db_rt_after_render if @db_rt_after_render
- db_percentage = (db_runtime * 100) / runtime
- " | DB: #{sprintf("%.5f", db_runtime)} (#{sprintf("%d", db_percentage)}%)"
+ db_percentage = db_runtime * 100 / runtime
+ " | DB: %.5f (%d%%)" % [db_runtime, db_percentage.to_i]
end
end
-end
+end

0 comments on commit f6d45ce

Please sign in to comment.