Skip to content

Commit f3ac49c

Browse files
ElvinEfendimattbrictson
authored andcommitted
Fix cache key generation performance for connection pooling (#417)
* change `args.to_s` to `args.hash` for better performance * update CHANGELOG
1 parent f8df591 commit f3ac49c

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ appear at the top.
66
## [Unreleased][]
77

88
* Your contribution here!
9+
* [#417](https://github.com/capistrano/sshkit/pull/417): Cache key generation for connections becomes slow when `known_hosts` is a valid `net/ssh` options and `known_hosts` file is big. This changes the cache key generation and fixes performance issue - [@ElvinEfendi](https://github.com/ElvinEfendi).
910

1011
## [1.15.1][] (2017-11-18)
1112

lib/sshkit/backends/connection_pool.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def close_connections
8888
private
8989

9090
def cache_key_for_connection_args(args)
91-
args.to_s
91+
args.hash
9292
end
9393

9494
def cache_enabled?

0 commit comments

Comments
 (0)