Skip to content

[FIX]: pre-compile the worker thread scripts into plain JavaScript #420

Description

@LLEGIT

Observation: A recent commit message mentions: [FIX]: add ts-node/esm loader to worker threads for dynamic auditor.

The Issue: Running ts-node in production or inside worker threads is generally considered an anti-pattern because it compiles TypeScript on the fly. This consumes significantly more memory, slows down thread startup time, and can cause memory leaks in a long-running Node.js application.

Improvement: You should pre-compile the worker thread scripts into plain JavaScript during your build step (using faster tools like swc or esbuild) and have the worker thread execute the compiled .js files instead of relying on ts-node at runtime.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions