discourse/config
David Taylor 59c239d85c
DEV: Speed up requests in development mode (#12890)
On every request, Rails checks to see whether any ruby code has been changed on the filesystem. The default FileUpdateChecker does this by iterating over every file on the autoload_paths and comparing its modified-time.

In Discourse, our autoload path of `/app` includes the `/app/assets` directory, and therefore thousands of non-ruby files (e.g. node_modules). This makes the `Dir["/app"]` call very slow (>100ms in my case). On my machine, every Rails-handled request spends around 150-200ms in the FileUpdateChecker. This commit introduces a couple of changes to completely eliminate this wasted time:

- The `/app/assets` directory is excluded from the file watchers. For me, this cut the time spent in the file_watcher to around 50-100ms

- Switches our development config to use the `EventedFileUpdateChecker`, which makes use of the `listen` gem to subscribe to os-specific notifications of changes. This completely removes the `FileUpdateChecker` from the critical path

On my machine, topic_list requests now return in around 80ms (previously >200ms). Live code reload still works as it did before
2021-04-29 15:40:55 +01:00
..
cloud/cloud66 DEV: enable frozen string literal on all files 2019-05-13 09:31:32 +08:00
environments DEV: Speed up requests in development mode (#12890) 2021-04-29 15:40:55 +01:00
initializers FEATURE: add reviewable score updated webhook (#12846) 2021-04-26 17:40:32 -07:00
locales FEATURE: new 'trim_incoming_emails' site setting (#12874) 2021-04-28 17:08:48 +02:00
application.rb DEV: Speed up requests in development mode (#12890) 2021-04-29 15:40:55 +01:00
boot.rb DEV: Remove deprecated bootsnap options (#11929) 2021-02-02 14:39:51 +01:00
cdn.yml.sample
database.yml FEATURE: allow setting postgres connection variables via environment 2021-04-14 13:31:32 -04:00
deploy.rb.sample
discourse_defaults.conf FEATURE: Allow a cluster_name to be configured and used for /srv/status (#12365) 2021-03-15 15:41:59 +11:00
discourse.config.sample
discourse.pill.sample
environment.rb DEV: enable frozen string literal on all files 2019-05-13 09:31:32 +08:00
logrotate.conf
multisite.yml.production-sample DEV: Remove db_id from sample multisite config. 2020-05-29 10:48:29 +08:00
nginx.global.conf
nginx.sample.conf DEV: add CORS header for all nginx rules of public folder files. (#12205) 2021-02-25 02:57:37 +05:30
projections.json DEV: Use .hbr for raw template file extension (#8883) 2020-02-11 13:38:12 -06:00
puma.rb remove daemonize setting (#12232) 2021-03-01 16:42:50 +11:00
routes.rb FEATURE: Allow theme tests to be run in production (take 2) (#12845) 2021-04-28 23:12:08 +03:00
sidekiq.yml
site_settings.yml FEATURE: new 'trim_incoming_emails' site setting (#12874) 2021-04-28 17:08:48 +02:00
spring.rb DEV: enable frozen string literal on all files 2019-05-13 09:31:32 +08:00
thin.yml.sample
unicorn_launcher
unicorn_upstart.conf
unicorn.conf.rb DEV: Enable unicorn logger in test environment 2021-02-11 15:24:15 +01:00