我有一个基于Typescript的React项目,我正在其中运行jest测试(也在TS中)。我可以很好地运行测试,但我试图分析一些需要相当长时间运行的性能。我试过使用Chrome Devtools to attach to the tests,它确实如此,但是它失败了,因为它是TS而不是普通的Js。有没有什么方法可以单独分析我的测试,以查看性能问题发生在哪里?使用VS程式码。
我有一个基于Typescript的React项目,我正在其中运行jest测试(也在TS中)。我可以很好地运行测试,但我试图分析一些需要相当长时间运行的性能。我试过使用Chrome Devtools to attach to the tests,它确实如此,但是它失败了,因为它是TS而不是普通的Js。有没有什么方法可以单独分析我的测试,以查看性能问题发生在哪里?使用VS程式码。
1条答案
按热度按时间kmpatx3s1#
它不是一个React项目,对我来说只是一个普通的TypeScript库,但我敢打赌它也适用于您的用例。
我发现唯一有效的解决方案是手动设置分析器v8-profiler-next。
然后,这将为您提供这样的CPU配置文件,它可以很好地与TypeScript配合使用。