From 100922b4c4f422e159bc4ba28a8bc162412f0a4d Mon Sep 17 00:00:00 2001 From: Chip Morningstar Date: Wed, 17 Jan 2024 17:30:22 -0800 Subject: [PATCH] feat: cleanup minor issues found during benchmark writeup -- Change the CPU profile sample interval to be more fine grained -- Fix a minor bug in legibilizeValue found while updating slogulator In service of #8647 but not it --- packages/SwingSet/src/controller/startNodeSubprocess.js | 2 +- packages/SwingSet/src/lib/kdebug.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/SwingSet/src/controller/startNodeSubprocess.js b/packages/SwingSet/src/controller/startNodeSubprocess.js index 3581242d412..a392b94944d 100644 --- a/packages/SwingSet/src/controller/startNodeSubprocess.js +++ b/packages/SwingSet/src/controller/startNodeSubprocess.js @@ -15,7 +15,7 @@ export function makeStartSubprocessWorkerNode( if (profileVats.includes(vatID)) { args.push('--cpu-prof'); args.push('--cpu-prof-interval'); - args.push('100'); + args.push('1'); args.push('--cpu-prof-name'); // cf. https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_282 nameDisplayArg = nameDisplayArg diff --git a/packages/SwingSet/src/lib/kdebug.js b/packages/SwingSet/src/lib/kdebug.js index c023f8ca620..bc95d4a82f8 100644 --- a/packages/SwingSet/src/lib/kdebug.js +++ b/packages/SwingSet/src/lib/kdebug.js @@ -70,7 +70,8 @@ export function legibilizeValue(val, slots, smallcaps) { return rest; case '$': case '&': { - const idx = Number(rest.slice(0, rest.indexOf('.'))); + const end = rest.indexOf('.'); + const idx = Number(rest.slice(0, end < 0 ? rest.length : end)); return `@${slots[idx]}`; } default: