| 506 | // {startTime}, {endTime} is the interval. |
| 507 | // {tree} is the processor of stacks. |
| 508 | function generateTree( |
| 509 | file, startTime, endTime, tree) { |
| 510 | let ticks = file.ticks; |
| 511 | let i = 0; |
| 512 | while (i < ticks.length && ticks[i].tm < startTime) { |
| 513 | i++; |
| 514 | } |
| 515 | |
| 516 | let tickCount = 0; |
| 517 | while (i < ticks.length && ticks[i].tm < endTime) { |
| 518 | tree.addStack(file, i); |
| 519 | i++; |
| 520 | tickCount++; |
| 521 | } |
| 522 | |
| 523 | return tickCount; |
| 524 | } |
| 525 | |
| 526 | function computeOptimizationStats(file, |
| 527 | timeStart = -Infinity, timeEnd = Infinity) { |