Skip to content
This repository has been archived by the owner on Mar 3, 2023. It is now read-only.

Change Document Polling from Time Interval to Event #8009

Merged
merged 14 commits into from
Jul 23, 2015

Conversation

jlord
Copy link

@jlord jlord commented Jul 21, 2015

🍐 ing with @nathansobo

Previously document polling happened through timed intervals causing continued use of CPU when the editor was unfocused.

This PR changes the polling to occur when the DOM is mutated or the window is resized (since that doesn't fall under a DOM mutation). Additionally it changes the way Atom updates the CSS so that it occurs as a mutation and the event is captured. Furthermore! It prevents the cursor from ever starting to blink if it wasn't blinking already which can be caused, for instance, when content is changed in the Settings View.

We've added test coverage but are still testing this branch out to be sure we've:

  • covered all the DOM changing scenarios
  • not added additional CPU usage when editor is active

cc @atom/feedback, try out this branch too if ya can 👍

Fixes #4019
Quality Initiative #7995

@@ -1,12 +1,15 @@
ViewRegistry = require '../src/view-registry'
{View} = require '../src/space-pen-extensions'

describe "ViewRegistry", ->
fdescribe "ViewRegistry", ->
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nof

nathansobo pushed a commit that referenced this pull request Jul 23, 2015
Change Document Polling from Time Interval to Event
@nathansobo nathansobo merged commit 731d6a2 into master Jul 23, 2015
@nathansobo nathansobo deleted the jl-ns-battery-life branch July 23, 2015 19:06
@nathansobo
Copy link
Contributor

Thanks @jlord!

@jlord
Copy link
Author

jlord commented Jul 24, 2015

wowoowo! Awesome! Thank you @nathansobo!

@ElegantSudo
Copy link

These PR's haven't changed much.

screen shot 2016-05-11 at 12 13 35 am

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants