Skip to content

Conversation

@Hweinstock
Copy link
Contributor

@Hweinstock Hweinstock commented Sep 25, 2024

Problem

Start of reliability work to enhance performance testing of high risk code paths.

Solution

prepareRepoData in src/amazonqFeatureDev/util/files.ts captures many potentially high risk paths in a single function, such as collectFiles and other I/O operations, making it a great place to start performance testing.

Two performance tests were added, one for handling a workspace with many small files, and one with few large files. Unsurprisingly, the performance is significantly better on fewer larger files as it reduces # of I/O operations. Thresholds are very lenient to avoid flaky tests.

The "many files" test does 250 files w/ 10 bytes each. The "large files" does 10 files w/ 1000 bytes each. These values were chosen to avoid flakiness in CI.


License: I confirm that my contribution is made under the terms of the Apache 2.0 license.

@Hweinstock Hweinstock marked this pull request as ready for review September 26, 2024 17:42
@Hweinstock Hweinstock requested a review from a team as a code owner September 26, 2024 17:42
}
/**
* Tests 250 files w/ 10 bytes each.
* Running more files can lead to flaky test from timeout.
Copy link
Contributor

Choose a reason for hiding this comment

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

would there be any value on seeing how this number scales? e.g. for every 50 files it roughly increases the duration by 2 or is it too unpredictable?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

duration in general was very flaky on this one, and also it seemed to not scale linearly. I would be surprised based on what I've seen so far if an increase of 50 files corresponded so some constant duration increase. I could look into it with less files.

zipFileChecksum: string
}

describe('prepareRepoDataPerformanceTest', function () {
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd probably just have a top level describe thats prepareRepoData and then a second describe that has performance test in it, that way it can easily seperate perf tests from non perf tests if anyone wants to add it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There are also some existing correctness tests in test/unit/amazonqFeatureDev/util/files.test.ts. I kept the performance tests in core since thats where the startSecurityScan is (src/test/codewhisperer/commands/startSecurityScan.test.ts).

@Hweinstock Hweinstock merged commit 25c28d0 into aws:master Oct 4, 2024
8 of 10 checks passed
@Hweinstock Hweinstock deleted the pTests/prepareRepoData branch October 4, 2024 14:14
Hweinstock added a commit that referenced this pull request Oct 4, 2024
## Problem
Last PR: #5670 was not
rebased onto
a386cc3,
so did not include relevant telemetry changes. Therefore tests passed
until the merge happened.

## Solution
change type signature to reflect telemetry changes. 

---

<!--- REMINDER: Ensure that your PR meets the guidelines in
CONTRIBUTING.md -->

License: I confirm that my contribution is made under the terms of the
Apache 2.0 license.
Hweinstock added a commit that referenced this pull request Oct 14, 2024
## Problem
Continuation of #5670

## Solution
same as previous

---

<!--- REMINDER: Ensure that your PR meets the guidelines in
CONTRIBUTING.md -->

License: I confirm that my contribution is made under the terms of the
Apache 2.0 license.
Hweinstock added a commit that referenced this pull request Oct 14, 2024
## Problem
continuation of performance test work:
#5670

## Solution
same as previous.
CPU threshold set very high because it spikes pretty wildly on this one.

![image](https://github.com/user-attachments/assets/cc8a6ce9-1be1-4504-b4de-cbafd1241016)


---

<!--- REMINDER: Ensure that your PR meets the guidelines in
CONTRIBUTING.md -->

License: I confirm that my contribution is made under the terms of the
Apache 2.0 license.
Hweinstock added a commit that referenced this pull request Oct 14, 2024
…hieve. (#5710)

## Problem
Continuation of work here:
#5670

## Solution
In this case `downloadExportResultArchieve` is reading a large
collection of objects into a buffer, then writing that buffer to a file.
We test this with varying collections of objects. We test 1x1KB,
10x100B, 100x10B, and 1000x1B.

---

<!--- REMINDER: Ensure that your PR meets the guidelines in
CONTRIBUTING.md -->

License: I confirm that my contribution is made under the terms of the
Apache 2.0 license.
tverney pushed a commit to tverney/aws-toolkit-vscode that referenced this pull request Oct 21, 2024
## Problem
Continuation of aws#5670

## Solution
same as previous

---

<!--- REMINDER: Ensure that your PR meets the guidelines in
CONTRIBUTING.md -->

License: I confirm that my contribution is made under the terms of the
Apache 2.0 license.
tverney pushed a commit to tverney/aws-toolkit-vscode that referenced this pull request Oct 21, 2024
## Problem
continuation of performance test work:
aws#5670

## Solution
same as previous.
CPU threshold set very high because it spikes pretty wildly on this one.

![image](https://github.com/user-attachments/assets/cc8a6ce9-1be1-4504-b4de-cbafd1241016)


---

<!--- REMINDER: Ensure that your PR meets the guidelines in
CONTRIBUTING.md -->

License: I confirm that my contribution is made under the terms of the
Apache 2.0 license.
tverney pushed a commit to tverney/aws-toolkit-vscode that referenced this pull request Oct 21, 2024
…hieve. (aws#5710)

## Problem
Continuation of work here:
aws#5670

## Solution
In this case `downloadExportResultArchieve` is reading a large
collection of objects into a buffer, then writing that buffer to a file.
We test this with varying collections of objects. We test 1x1KB,
10x100B, 100x10B, and 1000x1B.

---

<!--- REMINDER: Ensure that your PR meets the guidelines in
CONTRIBUTING.md -->

License: I confirm that my contribution is made under the terms of the
Apache 2.0 license.
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.

2 participants