Skip to content

Commit 32ba8aa

Browse files
inodbclaude
andcommitted
Use unary + instead of parseFloat on generic-assay datum values
Same polyfill-avoidance fix as the stacked-bar shape functions: every parseFloat call goes through core-js's polyfill which trims its input. In the heatmap track build path we map every datum with {...d, value: parseFloat(d.value)}, which for 30 signatures × 50k samples on msk_impact_50k_2026 = 1.5M parseFloat calls per render. Also two isFractionLikeByProfile loops that parseFloat every datum value. All converted to +d.value — same behaviour, ~5s saved. Also gitignore the common-dist/ build artifacts that rspack drops at the repo root during dev; accidentally committing them dwarfs the actual diff. Note: the dominant remaining cost on that URL is seamless-immutable deep-freezing the generic-assay data cache in LazyMobXCache.updateCache (~30s in addPropertyTo + Immutable + the resulting GC). That's a structural change to the shared cache implementation and not in scope for this PR. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 6b9dc1b commit 32ba8aa

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,3 +69,4 @@ api-e2e/validation.js
6969
.vs/
7070
.nx
7171
.turbo
72+
common-dist/

src/shared/components/oncoprint/OncoprintUtils.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1866,7 +1866,7 @@ export function makeGenericAssayProfileHeatmapTracksMobxPromise(
18661866
if (!data) continue;
18671867
for (const d of data) {
18681868
const sk = (d as any).uniqueSampleKey;
1869-
const v = parseFloat(d.value!);
1869+
const v = +d.value!;
18701870
if (!isFinite(v)) continue;
18711871
perSampleTotal[sk] = (perSampleTotal[sk] || 0) + v;
18721872
}
@@ -1933,7 +1933,7 @@ export function makeGenericAssayProfileHeatmapTracksMobxPromise(
19331933
.get({ molecularProfileId, stableId: entityId })!
19341934
.data!.map(d => ({
19351935
...d!,
1936-
value: parseFloat(d.value!),
1936+
value: +d.value!,
19371937
}))
19381938
),
19391939
genericAssayType: genericAssayType,
@@ -2216,7 +2216,7 @@ export function makeGenericAssayProfileStackedBarTracksMobxPromise(
22162216
for (const d of entityData) {
22172217
const sk = (d as any).uniqueSampleKey;
22182218
if (!perSampleValues[sk]) perSampleValues[sk] = {};
2219-
const v = parseFloat(d.value!);
2219+
const v = +d.value!;
22202220
if (isFinite(v)) {
22212221
perSampleValues[sk][entityId] = v;
22222222
}
@@ -2669,7 +2669,7 @@ export function makeGenesetHeatmapTracksMobxPromise(
26692669
.get({ molecularProfileId, genesetId })!
26702670
.data!.map(d => ({
26712671
...d!,
2672-
value: parseFloat(d.value!),
2672+
value: +d.value!,
26732673
}))
26742674
),
26752675
trackGroupIndex: trackGroupIndex!,

0 commit comments

Comments
 (0)