Skip to content

Restore cache functionality (default to off) #951

Closed

Description

@andrewmackrodt

#701 removed caching and I find performance of using ts-node unbelievably slow in any version beyond v7.0.1. The commit which removes caching behavior is in response to #672 (Cache doesn't take modified dependencies into account). I use ts-node in combination with TS_NODE_FILES=true and have never hit this problem nor was I able to reproduce the issue.

It seems that the maintainer is willing to accept a PR to add caching behavior in #920. Before I submit a PR, I'd like to confirm if it will be acceptable to restore the previous behavior, but have caching disabled by default and update the README to state that this is discouraged and link th #672 as to the reason why?

Activity

  1. cspotcode commented on Feb 3, 2020

    @cspotcode
    Collaborator

    @andrewmackrodt

    Discussion about how to re-add caching is over here: #908

    That thread has my thoughts on how to implement disk caching. For my use-cases, I'm focused on using it with transpile-only mode, since my projects perform typechecking as a separate step. It should be safe to enable automatically with transpile-only when we're not using transformers. For your case it would still need to be behind an opt-in flag, as you say. Even then, maintainers might be against it if it causes an influx of false bug reports. But I can't speak for anyone else.

  2. blakeembrey commented on Feb 4, 2020

    @blakeembrey
    Member

    SGTM behind a flag 👍

  3. ecraig12345 commented on Apr 22, 2020

    @ecraig12345

    Do you know when you'll be able to get to this? My team would like to use ts-node but the performance without caching is a huge blocker.

  4. cspotcode commented on Apr 22, 2020

    @cspotcode
    Collaborator

    @ecraig12345 not sure, pull requests are welcome. In the meantime you can use typescript-cached-transpile, linked over here: #908

    Turning on --transpile-only mode should make a big difference, too, maybe enough that you don't need caching.

  5. cspotcode commented on Jul 22, 2022

    @cspotcode
    Collaborator

    Closing since I doubt we'll get a PR for this, and ts-node --swc gives as much speed as you'd get with caching, but without the complexity of caching.

    If any sort of caching does get implemented, it'll probably be related to TS's incremental builds.

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