MCPcopy Create free account
hub / github.com/avoidwork/tenso / diff

Method diff

benchmarks/memory.js:50–61  ·  view source on GitHub ↗

* Calculates memory difference between two snapshots

(fromIndex, toIndex)

Source from the content-addressed store, hash-verified

48 * Calculates memory difference between two snapshots
49 */
50 diff (fromIndex, toIndex) {
51 const from = this.snapshots[fromIndex];
52 const to = this.snapshots[toIndex];
53
54 return {
55 rss: to.rss - from.rss,
56 heapTotal: to.heapTotal - from.heapTotal,
57 heapUsed: to.heapUsed - from.heapUsed,
58 external: to.external - from.external,
59 arrayBuffers: to.arrayBuffers - from.arrayBuffers
60 };
61 }
62
63 /**
64 * Formats bytes to human readable format using IEC standard

Callers 2

reportMethod · 0.95
testMemoryLeaksFunction · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected