Skip to content

expose function run performance metadata from function-runner - #53

Merged
jacobsteves merged 1 commit into
mainfrom
js.add-perf-metadata-to-run
Jun 4, 2026
Merged

jacobsteves merged 1 commit into
mainfrom
js.add-perf-metadata-to-run

Conversation

@jacobsteves

Copy link
Copy Markdown
Member

The function-runner returns performance metadata like instruction count, memory used, and module size. This PR adds these fields under metadata on the run result so that developers can easily read and optimize for these values.

@jacobsteves
jacobsteves force-pushed the js.add-perf-metadata-to-run branch from 242081e to 6fb7e37 Compare May 29, 2026 17:12
@jacobsteves
jacobsteves requested review from lopert and saga-dasgupta and removed request for saga-dasgupta May 29, 2026 17:21
Comment thread src/methods/run-function.ts
Comment thread src/methods/run-function.ts Outdated
@jacobsteves
jacobsteves force-pushed the js.add-perf-metadata-to-run branch from 6fb7e37 to 370c196 Compare June 2, 2026 14:48

@saga-dasgupta saga-dasgupta left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

lopert
lopert approved these changes Jun 2, 2026 •
Comment on lines +401 to +429
it.each([
["null", () => JSON.stringify(null)],
["string", () => JSON.stringify("not an object")],
[
"missing output",
() => runnerOutputJson((result) => delete result.output),
],
[
"missing instructions",
() => runnerOutputJson((result) => delete result.instructions),
],
[
"non-number instructions",
() => runnerOutputJson((result) => (result.instructions = "4423")),
],
[
"missing memory usage",
() => runnerOutputJson((result) => delete result.memory_usage),
],
[
"non-number memory usage",
() => runnerOutputJson((result) => (result.memory_usage = "1088")),
],
["missing size", () => runnerOutputJson((result) => delete result.size)],
[
"non-number size",
() => runnerOutputJson((result) => (result.size = "49")),
],
])(

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! really like this format.

@jacobsteves
jacobsteves merged commit b3803da into main Jun 4, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants