drool

Automated memory leak detection and analysis

  • 所有者: samccone/drool
  • 平台:
  • 許可證:
  • 分類:
  • 主題:
  • 喜歡:
    0
      比較:

Github星跟蹤圖

? Drool is an automation layer that is used to measure if a set of "clean" actions results in a DOM and or Listener leak.


Real World wins

Drool has made it far easier to identify memory leaks in an automated and reproducible way, for example:

Why am I making this?

After running perf/memory tests across multiple todomvc implementations, I found that almost all implementations have significant memory leaks on the most basic of tasks. Worse yet, most of these leaks were introduced at a framework level, or were introduced by "expert/(framework authors)". The question arose in my mind, if people who authored a framework are introducing leaks in the most trivial of applications, how can users be expected to create non-leaking implementations of much more complex applications.

Goals

Ideally Drool will leverage standard interfaces, such as todomvc, to test for leaks at a framework level. The result of which should help framework authors and developers realize that memory leaks are pervasive in the tools that we use.

Chrome devtools is a powerful utility layer for detecting memory issues, yet the fact still stands that most developers do not know how to use the tooling around it to arrive any thing that is directly actionable. Drool aims to be a generic automated abstraction layer, so people can get good "numbers" in a consistent way without having to deep dive into memory profiling.

Running

Ensure that you have at least version 2.26.436421 of chromedriver.

var drool = require('drool');
var assert = require('assert');

var driver = drool.start({
  chromeOptions: 'no-sandbox'
});

drool.flow({
  repeatCount: 100,
  setup: function() {
    driver.get('http://todomvc.com/examples/backbone/');
  },
  action: function() {
    driver.findElement(drool.webdriver.By.css('.new-todo')).sendKeys('find magical goats', drool.webdriver.Key.ENTER);
    driver.findElement(drool.webdriver.By.css('.todo-list li')).click();
    driver.findElement(drool.webdriver.By.css('.destroy')).click();
  },
  assert: function(after, initial) {
    assert.equal(initial.counts.nodes, after.counts.nodes, 'node count should match');
  }
}, driver)
.then(() => driver.quit())
.catch(e => {
  driver.quit();
  throw e;
})

View the API Docs

主要指標

概覽
名稱與所有者samccone/drool
主編程語言JavaScript
編程語言JavaScript (語言數: 2)
平台
許可證
所有者活动
創建於2015-06-19 01:40:39
推送於2018-11-12 04:17:06
最后一次提交2018-02-04 15:39:43
發布數9
最新版本名稱v0.6.0 (發布於 2018-02-04 15:39:53)
第一版名稱v0.1.0 (發布於 2015-07-13 19:29:06)
用户参与
星數1.5k
關注者數31
派生數53
提交數76
已啟用問題?
問題數22
打開的問題數9
拉請求數12
打開的拉請求數0
關閉的拉請求數7
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?