Skip to content

Commit

Permalink
[ruby/rack] Don't use async_thread_pool
Browse files Browse the repository at this point in the history
Not using async_thread_pool seems faster:

+-------------------------+---------+------+------+-----+-----+-------+--------------+
|              branch_name|plaintext|update|  json|   db|query|fortune|weighted_score|
+-------------------------+---------+------+------+-----+-----+-------+--------------+
|                   master|   101265| 13921|113730|33371|24701|  28719|          1794|
|disable-async-thread-pool|   102381| 13441|126911|40248|28379|  43834|          1928|
  • Loading branch information
p8 committed Dec 16, 2024
1 parent f749c9f commit cad07f3
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions frameworks/Ruby/rack/pg_db.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,7 @@ class PgDb

def initialize(connection_string = nil, max_connections = 512)
@connection = Sequel.connect(connection_string, max_connections: max_connections, sql_log_level: :warning)
if defined?(Falcon)
Sequel.extension :fiber_concurrency if defined?(Falcon)
else
@connection.extension :async_thread_pool
end
Sequel.extension :fiber_concurrency if defined?(Falcon)

prepare_statements
end
Expand Down

0 comments on commit cad07f3

Please sign in to comment.