Skip to content
Merged

Deploy #1200

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
89fe5f7
Support the column number property in frameTable, update the gecko pr…
dpalmeiro Aug 3, 2018
34e9ce7
Fix duplicate loop error in processed profile upgrader
dpalmeiro Aug 3, 2018
06f2c26
Fix bug in upgrader to gecko-12. Update the upgrader test cases to g…
dpalmeiro Aug 7, 2018
2bba550
Fix bug in upgrader to gecko-12. Update the upgrader test cases to g…
dpalmeiro Aug 7, 2018
42b2c0f
Merge branch 'master' of github.com:dpalmeiro/perf.html
dpalmeiro Aug 7, 2018
915bb04
Add column property to GeckoFrameStruct
dpalmeiro Aug 7, 2018
5110c0a
Fix version numbers in snapshot testing
dpalmeiro Aug 7, 2018
15cf2d4
Unify percentage by always using decimal numbers
zoepage Aug 8, 2018
ba12516
Update tests - #1094
zoepage Aug 8, 2018
bfc1de6
Merge branch 'master' into 1094-unify-percentage-values-in-calltree
zoepage Aug 8, 2018
7e1eaee
Set duration range default > 0 (#1175)
zoepage Aug 8, 2018
9df8c68
Merge branch 'master' into 1175-set-min-val-for-duration-range
zoepage Aug 8, 2018
1e779f4
Catches empty urls - #1137
zoepage Aug 8, 2018
a571003
Merge branch 'master' into 1137-missing-urls-in-tooltip
zoepage Aug 8, 2018
c9e04ba
Merge pull request #1186 from zoepage/1094-unify-percentage-values-in…
zoepage Aug 9, 2018
fd73cf6
Change comment from condition to explanation - #1175
zoepage Aug 9, 2018
d362710
Added check for non-zero duration in action - #1175
zoepage Aug 9, 2018
6e2d552
Merge branch '1175-set-min-val-for-duration-range' of https://github.…
zoepage Aug 9, 2018
56922ad
Merge branch 'master' into 1175-set-min-val-for-duration-range
zoepage Aug 9, 2018
1d5de82
Update uses and creations of the frameTable to be aware of the column…
dpalmeiro Aug 9, 2018
e197925
Checking for an empty string, not length - #1137
zoepage Aug 9, 2018
22a5b4a
Merge pull request #1187 from zoepage/1175-set-min-val-for-duration-r…
zoepage Aug 9, 2018
d8d8f28
Merge branch 'master' into 1137-missing-urls-in-tooltip
zoepage Aug 9, 2018
acc247e
Switched to type safe check - #1137
zoepage Aug 9, 2018
2c6645e
Merge pull request #1188 from zoepage/1137-missing-urls-in-tooltip
zoepage Aug 9, 2018
027a4d0
Update profile view snapshot with column property, and add the column…
dpalmeiro Aug 10, 2018
df866f1
Merge branch 'master' into master
dpalmeiro Aug 10, 2018
5fb79ed
Tweak the Reorderable component to only activate on mousemove
gregtatum Aug 14, 2018
97d0a50
Tweak the Reorderable component to only activate on mousemove (Merge …
gregtatum Aug 14, 2018
fd757fe
Merge branch 'master' into master
dpalmeiro Aug 16, 2018
9409021
Add support for column property in frameTable (Merge PR #1180)
gregtatum Aug 16, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/actions/profile-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -654,6 +654,10 @@ export function updatePreviewSelection(
}

export function commitRange(start: number, end: number): Action {
if (end === start) {
// Ensure that the duration of the range is non-zero.
end = end + 0.0001;
}
return {
type: 'COMMIT_RANGE',
start,
Expand Down
4 changes: 2 additions & 2 deletions src/components/shared/MarkerTooltipContents.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ function _markerDetailNullable<T: NotVoidOrNull>(
value: T | void | null,
fn: T => string = String
): React.Node {
if (value === undefined || value === null) {
if (value === undefined || value === null || fn(value).length === 0) {
return null;
}
return _markerDetail(key, label, value, fn);
Expand Down Expand Up @@ -607,7 +607,7 @@ function getMarkerDetails(
case 'Invalidation': {
return (
<div className="tooltipDetails">
{_markerDetail('url', 'URL', data.url)}
{_markerDetailNullable('url', 'URL', data.url)}
{_markerDetail('line', 'Line', data.line)}
</div>
);
Expand Down
14 changes: 11 additions & 3 deletions src/components/shared/Reorderable.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,6 @@ class Reorderable extends React.PureComponent<Props, State> {
];

this.setState({
phase: 'MANIPULATING',
manipulatingIndex: elementIndex,
manipulationDelta: 0,
destinationIndex: elementIndex,
Expand All @@ -188,6 +187,10 @@ class Reorderable extends React.PureComponent<Props, State> {
});

const mouseMoveListener = (event: EventWithPageProperties) => {
if (this.state.phase === 'RESTING') {
// Only start manipulating on the mouse move.
this.setState({ phase: 'MANIPULATING' });
}
const delta = clamp(
event[xy.pageXY] - mouseDownPos,
-spaceBefore,
Expand All @@ -199,14 +202,19 @@ class Reorderable extends React.PureComponent<Props, State> {
});
};
const mouseUpListener = (event: EventWithPageProperties) => {
window.removeEventListener('mousemove', mouseMoveListener, true);
window.removeEventListener('mouseup', mouseUpListener, true);
if (this.state.phase === 'RESTING') {
// A mousemove never transitioned to the MANIPULATING state, so
// exit out now.
return;
}
mouseMoveListener(event);
const destinationIndex = this.state.destinationIndex;
this.setState({
phase: 'FINISHING',
finalOffset: offsets[destinationIndex],
});
window.removeEventListener('mousemove', mouseMoveListener, true);
window.removeEventListener('mouseup', mouseUpListener, true);
setTimeout(() => {
this.setState({
phase: 'RESTING',
Expand Down
3 changes: 1 addition & 2 deletions src/profile-logic/call-tree.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,6 @@ export class CallTree {
const resourceType = this._resourceTable.type[resourceIndex];
const isJS = this._funcTable.isJS[funcIndex];
const libName = this._getOriginAnnotation(funcIndex);
const precision = this._isIntegerInterval ? 0 : 1;

let icon = null;
if (resourceType === resourceTypes.webhost) {
Expand All @@ -211,7 +210,7 @@ export class CallTree {
displayData = {
totalTime: formatNumber(totalTime),
selfTime: selfTime === 0 ? '—' : formatNumber(selfTime),
totalTimePercent: `${(100 * totalTimeRelative).toFixed(precision)}%`,
totalTimePercent: `${(100 * totalTimeRelative).toFixed(1)}%`,
name: funcName,
lib: libName,
// Dim platform pseudo-stacks.
Expand Down
10 changes: 9 additions & 1 deletion src/profile-logic/committed-ranges.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,15 @@ export function parseCommittedRanges(
if (!m) {
return { start: 0, end: 1000 };
}
return { start: Number(m[1]) * 1000, end: Number(m[2]) * 1000 };

const m1 = Number(m[1]);
let m2 = Number(m[2]);

if (m2 === m1) {
// Ensure that the duration of the range is non-zero.
m2 = m2 + 0.0001;
}
return { start: m1 * 1000, end: m2 * 1000 };
});
}

Expand Down
27 changes: 26 additions & 1 deletion src/profile-logic/gecko-profile-versioning.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {
} from './convert-markers';
import { UniqueStringArray } from '../utils/unique-string-array';

export const CURRENT_VERSION = 11; // The current version of the Gecko profile format.
export const CURRENT_VERSION = 12; // The current version of the Gecko profile format.

// Gecko profiles before version 1 did not have a profile.meta.version field.
// Treat those as version zero.
Expand Down Expand Up @@ -430,5 +430,30 @@ const _upgraders = {
}
convertToVersionElevenRecursive(profile);
},
[12]: profile => {
// This version will add column numbers to the JS functions and scripts.
// There is also a new property in the frameTable called "column" which
// swaps positions with the "category" property. The new value for
// "category" in the frameTable schema will be 5.
const oldSchemaCategoryIndex = 4;
const newSchemaCategoryIndex = 5;
function convertToVersionTwelveRecursive(p) {
for (const thread of p.threads) {
const schemaIndexCategory = thread.frameTable.schema.category;
for (const frame of thread.frameTable.data) {
if (frame.hasOwnProperty(schemaIndexCategory)) {
frame[newSchemaCategoryIndex] = frame[oldSchemaCategoryIndex];
frame[oldSchemaCategoryIndex] = null;
}
}
thread.frameTable.schema.category = newSchemaCategoryIndex;
thread.frameTable.schema.column = oldSchemaCategoryIndex;
}
for (const subprocessProfile of p.processes) {
convertToVersionTwelveRecursive(subprocessProfile);
}
}
convertToVersionTwelveRecursive(profile);
},
};
/* eslint-enable no-useless-computed-key */
1 change: 1 addition & 0 deletions src/profile-logic/process-profile.js
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,7 @@ function _processFrameTable(
func: frameFuncs,
implementation: geckoFrameStruct.implementation,
line: geckoFrameStruct.line,
column: geckoFrameStruct.column,
optimizations: geckoFrameStruct.optimizations,
length: geckoFrameStruct.length,
};
Expand Down
11 changes: 10 additions & 1 deletion src/profile-logic/processed-profile-versioning.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import {
import { UniqueStringArray } from '../utils/unique-string-array';
import { timeCode } from '../utils/time-code';

export const CURRENT_VERSION = 14; // The current version of the "processed" profile format.
export const CURRENT_VERSION = 15; // The current version of the "processed" profile format.

// Processed profiles before version 1 did not have a profile.meta.preprocessedProfileVersion
// field. Treat those as version zero.
Expand Down Expand Up @@ -637,5 +637,14 @@ const _upgraders = {
}
}
},
[15]: profile => {
// Profiles now have a column property in the frameTable
for (const thread of profile.threads) {
thread.frameTable.column = new Array(thread.frameTable.length);
for (let i = 0; i < thread.frameTable.length; i++) {
thread.frameTable.column[i] = null;
}
}
},
};
/* eslint-enable no-useless-computed-key */
2 changes: 2 additions & 0 deletions src/profile-logic/profile-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -617,6 +617,7 @@ export function collapsePlatformStackFrames(thread: Thread): Thread {
implementation: frameTable.implementation.slice(),
optimizations: frameTable.optimizations.slice(),
line: frameTable.line.slice(),
column: frameTable.column.slice(),
category: frameTable.category.slice(),
func: frameTable.func.slice(),
address: frameTable.address.slice(),
Expand Down Expand Up @@ -692,6 +693,7 @@ export function collapsePlatformStackFrames(thread: Thread): Thread {
newFrameTable.implementation.push(null);
newFrameTable.optimizations.push(null);
newFrameTable.line.push(null);
newFrameTable.column.push(null);
newFrameTable.category.push(null);
newFrameTable.func.push(newFuncIndex);
newFrameTable.address.push(-1);
Expand Down
2 changes: 2 additions & 0 deletions src/profile-logic/transforms.js
Original file line number Diff line number Diff line change
Expand Up @@ -760,6 +760,7 @@ export function collapseResource(
func: frameTable.func.slice(),
implementation: frameTable.implementation.slice(),
line: frameTable.line.slice(),
column: frameTable.column.slice(),
optimizations: frameTable.optimizations.slice(),
length: frameTable.length,
};
Expand Down Expand Up @@ -834,6 +835,7 @@ export function collapseResource(
newFrameTable.category.push(frameTable.category[frameIndex]);
newFrameTable.func.push(collapsedFuncIndex);
newFrameTable.line.push(frameTable.line[frameIndex]);
newFrameTable.column.push(frameTable.column[frameIndex]);
newFrameTable.implementation.push(
frameTable.implementation[frameIndex]
);
Expand Down
Loading