discourse/lib/freedom_patches
Sam Saffron 28292d2759
PERF: avoid shelling to get hostname aggressively
Previously we had many places in the app that called `hostname` to get
hostname of a server. This commit replaces the pattern in 2 ways

1. We cache the result in `Discourse.os_hostname` so it is only ever called once

2. We prefer to use Socket.gethostname which avoids making a shell command

This improves performance as we are not spawning hostname processes throughout
the app lifetime
2020-02-18 15:13:19 +11:00
..
active_record_attribute_methods.rb DEV: Apply Rubocop redundant return style 2019-11-14 15:10:51 -05:00
active_record_base.rb DEV: enable frozen string literal on all files 2019-05-13 09:31:32 +08:00
ams_include_without_root.rb DEV: enable frozen string literal on all files 2019-05-13 09:31:32 +08:00
better_handlebars_errors.rb DEV: enable frozen string literal on all files 2019-05-13 09:31:32 +08:00
fast_pluck.rb DEV: enable frozen string literal on all files 2019-05-13 09:31:32 +08:00
inflector_backport.rb DEV: enable frozen string literal on all files 2019-05-13 09:31:32 +08:00
match.rb DEV: enable frozen string literal on all files 2019-05-13 09:31:32 +08:00
open_uri_redirections.rb DEV: enable frozen string literal on all files 2019-05-13 09:31:32 +08:00
performance_fixes.rb DEV: enable frozen string literal on all files 2019-05-13 09:31:32 +08:00
pluck_first.rb DEV: pluck_first 2019-10-21 12:08:20 +01:00
postgresql_adapter.rb DEV: enable frozen string literal on all files 2019-05-13 09:31:32 +08:00
rack_patches.rb DEV: enable frozen string literal on all files 2019-05-13 09:31:32 +08:00
rails4.rb DEV: enable frozen string literal on all files 2019-05-13 09:31:32 +08:00
raw_handlebars.rb DEV: Use .hbr for raw template file extension (#8883) 2020-02-11 13:38:12 -06:00
reaper.rb DEV: enable frozen string literal on all files 2019-05-13 09:31:32 +08:00
regexp.rb DEV: enable frozen string literal on all files 2019-05-13 09:31:32 +08:00
safe_buffer.rb DEV: enable frozen string literal on all files 2019-05-13 09:31:32 +08:00
safe_migrations.rb DEV: enable frozen string literal on all files 2019-05-13 09:31:32 +08:00
schema_migration_details.rb PERF: avoid shelling to get hostname aggressively 2020-02-18 15:13:19 +11:00
sprockets_patches.rb Correct some missing spots for frozen_string_literal 2019-05-13 09:31:32 +08:00
translate_accelerator.rb DEV: properly pass keyword args 2019-11-08 17:30:42 +11:00
zeitwerk.rb PERF: avoid regex for hot path 2019-10-08 13:43:54 +11:00