atom/atom — pull request #4672 by maxbrunsfeld (2014-12-17 20:31:32+00:00)
Title: Avoid firing repeated config events while packages are loaded

Refs #4666.

#### Problem
Currently, each scoped settings file or snippets file that is loaded from a package causes expensive events to be emitted on `atom.config`. Emitting these events is expensive because:
* The act of adding scoped settings clears the scoped settings cache
* Callbacks registered via `atom.config::onDidChange` or `::observe` receive the new property value as an argument. Computing the new value requires re-merging the scoped properties with an *empty cache*.

Merging scoped properties recently became more expensive due to deep-merging.

#### Solution

This adds a new method to `Config` called `::pauseEvents` which allows multiple config changes to be 'rolled up', firing only one change event.

/cc @benogle @kevinsawicki