QA/Automation/Projects/Addons/MemChaser/Future Features: Difference between revisions

From MozillaWiki
< QA‎ | Automation‎ | Projects‎ | Addons‎ | MemChaser
Jump to navigation Jump to search
(Created page with "== Circular Buffer == === Usage/Overview === * Main data structure for graphs * Stores temporary GC (and CC,etc.) values * Conceptually is a linked list with a cycle from the tai...")
 
No edit summary
Line 4: Line 4:
* Stores temporary GC (and CC,etc.) values
* Stores temporary GC (and CC,etc.) values
* Conceptually is a linked list with a cycle from the tail to head, but it would be implemented using an array in JavaScript
* Conceptually is a linked list with a cycle from the tail to head, but it would be implemented using an array in JavaScript
=== Requirements ===
=== Requirements ===
* Have as little impact on garbage collection as possible
* Have as little impact on garbage collection as possible
* Have read/write capabilities with events emitted from writes
* Have read/write capabilities with events emitted from writes
* Read operations should not post-increment head index and should not delete the element being read
* Read operations should not post-increment head index and should not delete the element being read
=== Current Proposal ===
=== Current Proposal ===
==== Source ====
==== Source ====
https://github.com/dglol/memchaser/blob/circular-buffer/extension/lib/circular-buffer.js
https://github.com/dglol/memchaser/blob/circular-buffer/extension/lib/circular-buffer.js
==== Fields ====
* head
** index for the head/front of the buffer
* tail
** index for the tail/back of the buffer
* buffer
** array building block for this data structure
==== Methods ====
==== Methods ====
===== read([index]) =====
* CircularBuffer(length) (Constructor)
** reads from (head + index) if index is given
** only required a length to initialize
** else it reads the head value (i.e. index = 0)
** length defaults to 1 if a undefined value or negative number is given
=== Potential issues ===
 
* size() (Necessary)
** returns the size of the buffer
 
* read([index]) (Necessary)
** returns data from [head + index] if index is given
** else it returns the data at [head] (i.e. index = 0)
 
* write(data) (Necessary)
** writes data at the [tail] then increments tail index by one
** emits an event 'bufferWrite'
 
* clear() (Optional)
** resets the buffer, head index and tail index
 
* dequeue() (Optional)
** reads from [head], removes the data at [head] and increments head by one
 
* back() (Optional)
** reads from [tail]
 
=== Discussion items ===
==== JSON Blob vs Separate Buffers ====
==== JSON Blob vs Separate Buffers ====
* A JSON Blob of all the data ({gc: , cc:, etc}) has less overhead but writes would have to be synchronous
* A JSON Blob of all the data ({gc: , cc:, etc}) has less overhead but writes would have to be synchronous
* GC and related data occur at different times, so separate buffers allows asynchronous writing
* GC and related data occur at different times, so separate buffers allows asynchronous writing
== GC/CC Parser ==
== GC/CC Parser ==
== HTML5/Canvas ==
== HTML5/Canvas ==

Revision as of 19:45, 26 January 2012

Circular Buffer

Usage/Overview

  • Main data structure for graphs
  • Stores temporary GC (and CC,etc.) values
  • Conceptually is a linked list with a cycle from the tail to head, but it would be implemented using an array in JavaScript

Requirements

  • Have as little impact on garbage collection as possible
  • Have read/write capabilities with events emitted from writes
  • Read operations should not post-increment head index and should not delete the element being read

Current Proposal

Source

https://github.com/dglol/memchaser/blob/circular-buffer/extension/lib/circular-buffer.js

Fields

  • head
    • index for the head/front of the buffer
  • tail
    • index for the tail/back of the buffer
  • buffer
    • array building block for this data structure

Methods

  • CircularBuffer(length) (Constructor)
    • only required a length to initialize
    • length defaults to 1 if a undefined value or negative number is given
  • size() (Necessary)
    • returns the size of the buffer
  • read([index]) (Necessary)
    • returns data from [head + index] if index is given
    • else it returns the data at [head] (i.e. index = 0)
  • write(data) (Necessary)
    • writes data at the [tail] then increments tail index by one
    • emits an event 'bufferWrite'
  • clear() (Optional)
    • resets the buffer, head index and tail index
  • dequeue() (Optional)
    • reads from [head], removes the data at [head] and increments head by one
  • back() (Optional)
    • reads from [tail]

Discussion items

JSON Blob vs Separate Buffers

  • A JSON Blob of all the data ({gc: , cc:, etc}) has less overhead but writes would have to be synchronous
  • GC and related data occur at different times, so separate buffers allows asynchronous writing

GC/CC Parser

HTML5/Canvas

History Graph

Time Calculations

Memory Report per Compartment

Blocked by https://bugzilla.mozilla.org/show_bug.cgi?id=687724