Skip to content

Conversation

@Lucas-C
Copy link

@Lucas-C Lucas-C commented Oct 1, 2025

First, thank you for developping & maintaining this great tool 👍

Description

I'm using artillery in a TypeScript projet, and I noticed repeated log lines like this:

Bundled Typescript file into JS. New processor path: .../functions.js
Bundled Typescript file into JS. New processor path: .../functions.js
Bundled Typescript file into JS. New processor path: .../functions.js

I checked the source code in prepare-test-execution-plan.js and realized that repeated transpilation of the same TS file where occuring.

First, a function named transpileTypeScript() has been introduced at some point, and it could be used in replaceProcessorIfTypescript() to avoid repeating code, so this light refactoring is included in this PR.

Second and more importantly, given that transpileTypeScript() is already called beforehand in prepareTestExecutionPlan() at the beggining of a test execution, invoking it again in replaceProcessorIfTypescript() does not seem necessery.
In this MR I added a test so that the transpiling step is skipped if the JS output file already exists in the dist/ directory.
But maybe this transpiling step is simply never needed, you probably know better than me 🙂

Anyway, this PR provides a very substantial performance improvement when using artillery with TS hooks.

Pre-merge checklist

This is for use by the Artillery team. Please leave this in if you're contributing to Artillery.

  • Does this require an update to the docs?
  • Does this require a changelog entry?

@CLAassistant
Copy link

CLAassistant commented Oct 1, 2025

CLA assistant check
All committers have signed the CLA.

Comment on lines +154 to +155
//TODO: move require to top of file when Lambda bundle size issue is solved
//must be conditionally required for now as this package is removed in Lambda for now to avoid bigger package sizes
Copy link
Author

Choose a reason for hiding this comment

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

Note: I simply move/preserved this pre-existing comment there.

external: ['@playwright/test', ...userExternalPackages]
});

return outputPath;
Copy link
Author

Choose a reason for hiding this comment

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

Note: this return value was never used so I simply removed it.

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