Skip to content

Benchmarks for @shopify/toml-patch #5678

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: shauns/04-17-add_dependency_on_shopify_toml-patch
Choose a base branch
from

Conversation

shauns
Copy link
Contributor

@shauns shauns commented Apr 22, 2025

WHY are these changes introduced?

To benchmark and compare the performance of two different approaches for updating TOML configuration files: a new WASM-based implementation versus the existing JavaScript implementation.

WHAT is this pull request doing?

  • Adds a benchmark file (toml-patch-wasm.bench.ts) to measure and compare the performance of TOML patching implementations

How to test your changes?

Run the benchmark tests with pnpm vitest bench. It'll give a comparison between pure JS & WASM based patching. At time of writing they're roughly equivalent.

Copy link
Contributor Author

shauns commented Apr 22, 2025

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

Copy link
Contributor

Differences in type declarations

We detected differences in the type declarations generated by Typescript for this branch compared to the baseline ('main' branch). Please, review them to ensure they are backward-compatible. Here are some important things to keep in mind:

  • Some seemingly private modules might be re-exported through public modules.
  • If the branch is behind main you might see odd diffs, rebase main into this branch.

New type declarations

We found no new type declarations in this PR

Existing type declarations

packages/cli-kit/dist/public/common/object.d.ts
@@ -1,4 +1,4 @@
-import { Dictionary, ObjectIterator, PropertyPath, ValueKeyIteratee } from 'lodash';
+import { Dictionary, ObjectIterator, ValueKeyIteratee } from 'lodash';
 /**
  * Deep merges the two objects and returns a new object with the merge result.
  *
@@ -53,7 +53,7 @@ export declare function deepDifference(one: object, two: object): [object, objec
  * @param path - The path of the property to get.
  * @returns - Returns the resolved value.
  */
-export declare function getPathValue<T = object>(object: object, path: PropertyPath): T | undefined;
+export declare function getPathValue<T = object>(object: object, path: string): T | undefined;
 /**
  * Sets the value at path of object. If a portion of path doesn't exist, it's create.
  *
@@ -62,7 +62,7 @@ export declare function getPathValue<T = object>(object: object, path: PropertyP
  * @param value - The value to set.
  * @returns - Returns object.
  */
-export declare function setPathValue(object: object, path: PropertyPath, value?: unknown): object;
+export declare function setPathValue(object: object, path: string, value?: unknown): object;
 /**
  * Removes the property at path of object.
  *
@@ -70,7 +70,7 @@ export declare function setPathValue(object: object, path: PropertyPath, value?:
  * @param path - The path of the property to unset.
  * @returns - Returns true if the property is deleted or not found, else false.
  */
-export declare function unsetPathValue(object: object, path: PropertyPath): boolean;
+export declare function unsetPathValue(object: object, path: string): boolean;
 /**
  * Checks if value is an empty object, collection, map, or set.
  *

@shauns shauns marked this pull request as ready for review April 22, 2025 13:45
@shauns shauns requested a review from a team as a code owner April 22, 2025 13:45
Copy link
Contributor

github-actions bot commented Apr 22, 2025

Coverage report

St.
Category Percentage Covered / Total
🟡 Statements
76.63% (-0.15% 🔻)
9546/12457
🟡 Branches
71.78% (-0.05% 🔻)
4686/6528
🟡 Functions
76.45% (-0.11% 🔻)
2473/3235
🟡 Lines
77.16% (-0.16% 🔻)
9025/11697
Show new covered files 🐣
St.
File Statements Branches Functions Lines
🔴
... / toml-patch-wasm.bench.ts
0% 0% 0% 0%

Test suite run success

2235 tests passing in 973 suites.

Report generated by 🧪jest coverage report action from d24b6d3

@shauns shauns force-pushed the shauns/04-17-add_dependency_on_shopify_toml-patch branch from 79e3793 to a6c0d9d Compare April 22, 2025 13:51
@shauns shauns force-pushed the shauns/04-22-benchmark-toml-wasm branch from 4f61580 to b012a65 Compare April 22, 2025 13:51
Copy link
Contributor

We detected some changes at packages/*/src and there are no updates in the .changeset.
If the changes are user-facing, run "pnpm changeset add" to track your changes and include them in the next release CHANGELOG.

1 similar comment
Copy link
Contributor

We detected some changes at packages/*/src and there are no updates in the .changeset.
If the changes are user-facing, run "pnpm changeset add" to track your changes and include them in the next release CHANGELOG.

@shauns shauns changed the base branch from shauns/04-17-add_dependency_on_shopify_toml-patch to graphite-base/5678 April 22, 2025 15:52
@shauns shauns force-pushed the graphite-base/5678 branch from a6c0d9d to d4a22e2 Compare April 23, 2025 11:37
@shauns shauns force-pushed the shauns/04-22-benchmark-toml-wasm branch from b012a65 to 8ffdf21 Compare April 23, 2025 11:37
@shauns shauns changed the base branch from graphite-base/5678 to shauns/04-17-add_dependency_on_shopify_toml-patch April 23, 2025 11:37
@shauns shauns force-pushed the shauns/04-22-benchmark-toml-wasm branch from 8ffdf21 to d24b6d3 Compare April 23, 2025 12:17
@shauns shauns force-pushed the shauns/04-17-add_dependency_on_shopify_toml-patch branch from d4a22e2 to 83bd3c9 Compare April 23, 2025 12:17
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.

1 participant