Skip to content

Commit

Permalink
chore: revert caching to see if it fixes NUT
Browse files Browse the repository at this point in the history
  • Loading branch information
WillieRuemmele committed Sep 17, 2024
1 parent 42a9c8d commit ebdff15
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 15 deletions.
15 changes: 6 additions & 9 deletions src/resolve/sourceComponent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ export class SourceComponent implements MetadataComponent {
private markedForDelete = false;
private destructiveChangesType?: DestructiveChangesType;
private pathContentMap = new Map<string, string>();
private calculatedContent: string[] = [];

public constructor(
props: ComponentProperties,
Expand Down Expand Up @@ -147,17 +146,15 @@ export class SourceComponent implements MetadataComponent {
}

public walkContent(): string[] {
if (!this.calculatedContent.length) {
if (this.content) {
for (const fsPath of this.walk(this.content)) {
if (fsPath !== this.xml) {
this.calculatedContent.push(fsPath);
}
const sources: string[] = [];
if (this.content) {
for (const fsPath of this.walk(this.content)) {
if (fsPath !== this.xml) {
sources.push(fsPath);
}
}
}

return this.calculatedContent;
return sources;
}
/**
* returns the children of a parent SourceComponent
Expand Down
6 changes: 0 additions & 6 deletions test/resolve/adapters/bundleSourceAdapter.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,6 @@ import { CONTENT_PATH as LWC_CONTENT_PATH } from '../../mock/type-constants/lwcB
import { RegistryAccess } from '../../../src';

describe('BundleSourceAdapter with AuraBundle', () => {
beforeEach(() => {
// @ts-ignore reset cache
bundle.COMPONENT.calculatedContent = [];
// @ts-ignore reset cache
lwcBundle.COMPONENT.calculatedContent = [];
});
const registryAccess = new RegistryAccess();
const adapter = new BundleSourceAdapter(bundle.COMPONENT.type, registryAccess, undefined, bundle.COMPONENT.tree);

Expand Down

2 comments on commit ebdff15

@svc-cli-bot
Copy link
Collaborator

Choose a reason for hiding this comment

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

Benchmark

Benchmark suite Current: ebdff15 Previous: 42a9c8d Ratio
eda-componentSetCreate-linux 240 ms 245 ms 0.98
eda-sourceToMdapi-linux 2409 ms 2356 ms 1.02
eda-sourceToZip-linux 1897 ms 1881 ms 1.01
eda-mdapiToSource-linux 2923 ms 2848 ms 1.03
lotsOfClasses-componentSetCreate-linux 434 ms 426 ms 1.02
lotsOfClasses-sourceToMdapi-linux 3746 ms 3789 ms 0.99
lotsOfClasses-sourceToZip-linux 3277 ms 3048 ms 1.08
lotsOfClasses-mdapiToSource-linux 3631 ms 3608 ms 1.01
lotsOfClassesOneDir-componentSetCreate-linux 761 ms 734 ms 1.04
lotsOfClassesOneDir-sourceToMdapi-linux 6582 ms 6507 ms 1.01
lotsOfClassesOneDir-sourceToZip-linux 5925 ms 5620 ms 1.05
lotsOfClassesOneDir-mdapiToSource-linux 6652 ms 6504 ms 1.02

This comment was automatically generated by workflow using github-action-benchmark.

@svc-cli-bot
Copy link
Collaborator

Choose a reason for hiding this comment

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

Benchmark

Benchmark suite Current: ebdff15 Previous: 42a9c8d Ratio
eda-componentSetCreate-win32 736 ms 698 ms 1.05
eda-sourceToMdapi-win32 4826 ms 4607 ms 1.05
eda-sourceToZip-win32 3311 ms 3199 ms 1.04
eda-mdapiToSource-win32 6432 ms 6178 ms 1.04
lotsOfClasses-componentSetCreate-win32 1315 ms 1323 ms 0.99
lotsOfClasses-sourceToMdapi-win32 8429 ms 8490 ms 0.99
lotsOfClasses-sourceToZip-win32 5525 ms 4983 ms 1.11
lotsOfClasses-mdapiToSource-win32 8594 ms 7822 ms 1.10
lotsOfClassesOneDir-componentSetCreate-win32 2134 ms 2091 ms 1.02
lotsOfClassesOneDir-sourceToMdapi-win32 14095 ms 14016 ms 1.01
lotsOfClassesOneDir-sourceToZip-win32 9293 ms 9571 ms 0.97
lotsOfClassesOneDir-mdapiToSource-win32 14182 ms 14312 ms 0.99

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.