Skip to content
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

Use bulk default activity arguments and remove getEffectiveActivityArguments calls #1605

Open
wants to merge 11 commits into
base: develop
Choose a base branch
from

Conversation

AaronPlave
Copy link
Contributor

@AaronPlave AaronPlave commented Jan 29, 2025

Exclusively rely on getActivityEffectiveArgumentsBulk instead of the deprecated getActivityEffectiveArguments. This entails using the newly made cache of these arguments as well as fetching the set of needed default args for a plan during export. Improves loading performance of activity and span parameters. Additionally improves plan export performance drastically. Previously, plan export performance inversely correlated to the number of activities in the plan since each activity needed a query to get default args. This meant on large plans with thousands of activities, plan export could take tens of minutes if not much longer. With this change, plan export should be nearly instantaneous.

Closes #1594

@AaronPlave AaronPlave requested a review from a team as a code owner January 29, 2025 19:24
@AaronPlave AaronPlave added performance A code change that improves performance refactor A code change that neither fixes a bug nor adds a feature labels Jan 29, 2025
// Get effective arguments for all revisions by coalescing defaults with args supplied in revision
effectiveRevisionArguments = activityRevisions.map(revision => {
const defaultArguments = $activityArgumentDefaultsMap[activityType?.name || ''] ?? null;
defaultArguments.effectiveRevisionArguments = activityRevisions.map(revision => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should it be setting an effectiveRevisionArguments on the defaultArguments object here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Whoops nope, not sure how I ended up with that, good catch. Should just be assigning effectiveRevisionArguments to the right side I believe.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

src/components/plan/PlanForm.svelte Show resolved Hide resolved
@@ -20,7 +21,7 @@
placement: Placement;
};

export let rowData: RowData | undefined;
export let cancellable: boolean = true;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we rename this to explicitly tie it to downloading? e.g. isDownloadCancellable or something like that?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@AaronPlave AaronPlave force-pushed the feature/1594/get-effective-directive-arg-rework branch from 6e0f20a to d01275f Compare February 3, 2025 18:41
@AaronPlave AaronPlave force-pushed the feature/1594/get-effective-directive-arg-rework branch from eff39ba to d960eee Compare February 4, 2025 18:23
Copy link

sonarqubecloud bot commented Feb 4, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance A code change that improves performance refactor A code change that neither fixes a bug nor adds a feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use cached default arguments when computing effective arguments instead of making a request each time
2 participants