Skip to content

Instantly share code, notes, and snippets.

@ritikesh
Last active November 20, 2019 07:02
Show Gist options
  • Save ritikesh/6da4adb81c2e68b11688201a27f14661 to your computer and use it in GitHub Desktop.
Save ritikesh/6da4adb81c2e68b11688201a27f14661 to your computer and use it in GitHub Desktop.
ActiveRecord::Base.logger = nil
subject = "Benchmarking"
description = "Benchmarking " * 1000
type = "Incident"
email = "andrea@freshservice.com"
status = 2
source = 2
priority = 1
Benchmark.bmbm { |x|
x.report { 1000.times do |n|
ticket = Ticket.create! do |s|
s.subject = subject
s.email = email
s.status = status
s.source = source
s.priority = priority
s.ticket_type = type
s.description = description
end
}
}
+------------------------------------------+--------------+-----------+------------+--------------+
| Benchmarks | User | System | Total | Real |
+------------------------------------------+--------------+-----------+------------+--------------+
| Current Setup | 119.270000 | 52.160000 | 171.430000 | (180.613048) |
| | 118.430000 | 51.880000 | 170.310000 | (179.512295) |
+------------------------------------------+--------------+-----------+------------+--------------+
| After DB Alters | 120.610000 | 52.410000 | 173.020000 | (182.535895) |
| | 118.840000 | 51.350000 | 170.190000 | (179.708828) |
+------------------------------------------+--------------+-----------+------------+--------------+
| After DB Alters + Rails Encoding changes | 121.010000 | 51.990000 | 173.000000 | (182.335528) |
| | 119.090000 | 51.820000 | 170.910000 | (180.259997) |
+------------------------------------------+--------------+-----------+------------+--------------+
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment