rails_benchmark_suite 0.2.3 → 0.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/rails_benchmark_suite/runner.rb +17 -0
- data/lib/rails_benchmark_suite/version.rb +1 -1
- data/lib/rails_benchmark_suite.rb +0 -17
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 93d771423786c8f5cefc45aaabb973a6bf407d9025093a563ae938cf51562e1d
|
|
4
|
+
data.tar.gz: 3a1568af625855012c88f44ad6172bdf794accee645d6233a77bb956ff1c7e90
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: bf1b4acd86c9804e67b2d043441cdf09031dfc02d6152f36b486832b842d262bccf6d47ed5bc13a24fc795427498dc030c335b8d598543f067dd1a94db318011
|
|
7
|
+
data.tar.gz: 6d5c9d5310b5ab617cba3db8903da03fb14df73f6887dfed199ce2e073a1c3377a57e927b18f66c04d350b6c462affdb6e90d6cdcd0b5cd4764bf797a740e96f
|
|
@@ -15,6 +15,23 @@ module RailsBenchmarkSuite
|
|
|
15
15
|
end
|
|
16
16
|
|
|
17
17
|
def run
|
|
18
|
+
# Senior Fix: Isolate from host application's database with Shared Cache (v0.2.4)
|
|
19
|
+
ActiveRecord::Base.establish_connection(
|
|
20
|
+
adapter: "sqlite3",
|
|
21
|
+
database: "file::memory:?cache=shared",
|
|
22
|
+
pool: 16,
|
|
23
|
+
timeout: 5000
|
|
24
|
+
)
|
|
25
|
+
|
|
26
|
+
# SQLite Performance Tuning for multi-threaded benchmarks
|
|
27
|
+
db = ActiveRecord::Base.connection.raw_connection
|
|
28
|
+
db.execute("PRAGMA journal_mode = WAL") # Write-Ahead Logging
|
|
29
|
+
db.execute("PRAGMA synchronous = NORMAL") # Faster writes
|
|
30
|
+
db.execute("PRAGMA busy_timeout = 5000") # Wait for lock instead of crashing
|
|
31
|
+
|
|
32
|
+
# Load Schema
|
|
33
|
+
RailsBenchmarkSuite::Schema.load
|
|
34
|
+
|
|
18
35
|
puts "Running RailsBenchmarkSuite Benchmarks..." unless @json_output
|
|
19
36
|
puts system_report unless @json_output
|
|
20
37
|
puts "\n" unless @json_output
|
|
@@ -18,23 +18,6 @@ module RailsBenchmarkSuite
|
|
|
18
18
|
end
|
|
19
19
|
|
|
20
20
|
def self.run(json: false)
|
|
21
|
-
# Enforce database isolation: Always use in-memory SQLite, ignoring host app DB
|
|
22
|
-
ActiveRecord::Base.establish_connection(
|
|
23
|
-
adapter: "sqlite3",
|
|
24
|
-
database: "file:rails_benchmark_suite_mem?mode=memory&cache=shared",
|
|
25
|
-
pool: 20,
|
|
26
|
-
timeout: 10000
|
|
27
|
-
)
|
|
28
|
-
|
|
29
|
-
# SQLite Performance Tuning for multi-threaded benchmarks
|
|
30
|
-
db = ActiveRecord::Base.connection.raw_connection
|
|
31
|
-
db.execute("PRAGMA journal_mode = WAL") # Write-Ahead Logging
|
|
32
|
-
db.execute("PRAGMA synchronous = NORMAL") # Faster writes
|
|
33
|
-
db.execute("PRAGMA busy_timeout = 5000") # Wait for lock instead of crashing
|
|
34
|
-
|
|
35
|
-
# Load Schema
|
|
36
|
-
RailsBenchmarkSuite::Schema.load
|
|
37
|
-
|
|
38
21
|
# Load suites
|
|
39
22
|
Dir[File.join(__dir__, "rails_benchmark_suite", "suites", "*.rb")].each { |f| require f }
|
|
40
23
|
|