rails_benchmark_suite 0.2.3 → 0.2.5

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e3b1ca672519dfe2c0b1b8a7bc9955c388f88a952be61d6c662714fd91982798
4
- data.tar.gz: 475b0ea6cba1b90af9991553cdc4af9622a6543f9f1f9129a1bd57b3502550dc
3
+ metadata.gz: d942ece685b0dd024227075db9d16fa1d2cca81ee91921d3926814bd033d4c08
4
+ data.tar.gz: dce496aed3eea5cb5448f515e5c029eab4e5ad744ce6bb41666f7525555e9cb9
5
5
  SHA512:
6
- metadata.gz: 2dc117883323f4a6a356ec9a21e5e7e6a0a7ceef15d3ef7883199b9c02d06ae0b827bbc215420c1c70e4377c5387eaff9e515d0f78a49b4985d659484a886afd
7
- data.tar.gz: d0e3f85050d98e244c0a2f3c6dc525ff467fda377973233823f0b068ab7c7b328d3069e3363bef96e92bab535e8d9d4247cb8acd5488271c92b4bad69366f2d2
6
+ metadata.gz: 57f467d74ec8c0f566549ab140935bd19d3b296f727be40f83c4da5c771da4b8594ed54d668ebca17a2937d64b3d2c80efedac2d48617bfcc1c2055886782a65
7
+ data.tar.gz: 11902dda9958604c7c6770c4d43bb123b2f7e9a5f37187cfae73232a9d7ad8ef55fd3b38b360a597652d23ad4e5c2ff157f09aa646ec6005ac40567d7c9891af
@@ -15,6 +15,25 @@ 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.5)
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
+ raw_db = ActiveRecord::Base.connection.raw_connection
28
+ raw_db.execute("PRAGMA journal_mode = WAL") # Write-Ahead Logging
29
+ raw_db.execute("PRAGMA synchronous = NORMAL") # Faster writes
30
+
31
+ # Add a custom busy handler for extra resilience (v0.2.5)
32
+ raw_db.busy_handler { |count| sleep(0.01); count < 100 }
33
+
34
+ # Load Schema
35
+ RailsBenchmarkSuite::Schema.load
36
+
18
37
  puts "Running RailsBenchmarkSuite Benchmarks..." unless @json_output
19
38
  puts system_report unless @json_output
20
39
  puts "\n" unless @json_output
@@ -1,3 +1,3 @@
1
1
  module RailsBenchmarkSuite
2
- VERSION = "0.2.3"
2
+ VERSION = "0.2.5"
3
3
  end
@@ -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
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_benchmark_suite
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - RailsBenchmarkSuite Contributors