middleman/middleman-core/lib/middleman-core
Mark Rowe 65462cbc43 Improve performance of ignoring files (#1971)
* Determine the type of ignore pattern once per pattern.

Performing this work when checking when each file was ignored accounted
for around 4.5 of the 6 seconds that processing ignored files was taking
on a site with ~14,000 files and a small number of ignore patterns.
After this change, processing ignored files takes less than 1.5 seconds.

* Cache the normalized paths on Resource and SourceFile.

Normalizing the paths is expensive, so avoid doing it multiple
times. `Util::normalize_path` is marked as memoized, but this
is not effective as:

1. `memoize` doesn't appear to work with module functions.
2. Checking whether we have a memoized value is as expensive as
   normalizing the path.

This further drops the time it takes to process ignored files on a site
with ~14,000 files from ~1.5 seconds to ~0.6 seconds.
2016-08-12 16:33:18 -07:00
..
core_extensions Experiment with non-rack rewriters 2016-04-22 15:52:42 -07:00
dns_resolver Refactor preview server to support server_name and bind_address 2015-07-01 20:56:56 +02:00
extensions Fix japanese characters encoding in URLs 2016-07-10 17:03:22 -07:00
meta_pages show version on middleman page 2016-02-04 20:44:39 -05:00
preview_server Cop 2016-01-14 11:21:42 -08:00
renderers Try to be safe 2016-06-23 12:41:23 -07:00
sitemap Improve performance of ignoring files (#1971) 2016-08-12 16:33:18 -07:00
sources Eliminate quadratic behavior in `SourceWatcher::poll_once!`. 2016-08-11 00:24:42 -07:00
step_definitions Differentiate polling from find_new_files to remove double reads in build mode 2016-01-20 12:20:27 -08:00
util Fix japanese characters encoding in URLs 2016-07-10 17:03:22 -07:00
application.rb Fix #1866 2016-05-31 13:15:37 -07:00
builder.rb Fix #1822 2016-03-01 09:25:05 -08:00
callback_manager.rb Cop 2016-01-14 11:21:42 -08:00
config_context.rb Minor perf tweaks 2016-04-21 16:12:33 -07:00
configuration.rb Run helper after collections. Fixes #1226 2016-02-24 14:20:42 -08:00
contracts.rb Add some options to watcher to opt out of features later 2016-01-20 13:34:12 -08:00
core_extensions.rb Perf 2016-01-14 11:05:41 -08:00
dns_resolver.rb Refactor preview server to support server_name and bind_address 2015-07-01 20:56:56 +02:00
extension.rb Minor perf tweaks 2016-04-21 16:12:33 -07:00
extension_manager.rb Move block run 2016-01-12 17:11:56 -08:00
extensions.rb Expose all config options to CLIs. Helps with #1829 2016-03-12 13:55:25 -08:00
file_renderer.rb Minor perf tweaks 2016-04-21 16:12:33 -07:00
load_paths.rb Allow findup to be false 2016-02-03 09:57:30 -08:00
logger.rb Run helper after collections. Fixes #1226 2016-02-24 14:20:42 -08:00
meta_pages.rb merge in fixes from stable 2015-09-17 13:53:43 -07:00
preview_server.rb Allow restarting external-pipeline without orphaning processes 2016-04-12 10:00:09 -07:00
profiling.rb Clean up some Rubocop warnings that were previously suppressed. 2014-05-24 00:37:46 -07:00
rack.rb Run helper after collections. Fixes #1226 2016-02-24 14:20:42 -08:00
sources.rb Improve performance of ignoring files (#1971) 2016-08-12 16:33:18 -07:00
step_definitions.rb merge in fixes from stable 2015-09-17 13:53:43 -07:00
template_context.rb Fix japanese characters encoding in URLs 2016-07-10 17:03:22 -07:00
template_renderer.rb Minor perf tweaks 2016-04-21 16:12:33 -07:00
util.rb split up util module, fix some rubocop complaints 2016-01-31 14:13:52 -08:00
version.rb Fix japanese characters encoding in URLs 2016-07-10 17:03:22 -07:00