“发布运行”与正常执行有何不同? [英] What does 'pub run' differs from normal execution?
问题描述
我发现存在一些差异,我无法弄清楚在使用 pub执行二进制文件时,如何运行bin_executable.dart args
而不是 dart bin / bin_executable.dart args
。
I find there are some differences that I can't figure out which nor how when executing a binary withpub run bin_executable.dart args
rather than dart bin/bin_executable.dart args
.
第一种形式的执行速度明显慢,输出效果最差,有时甚至是错误的。 。
Execution is notably slow in the first form, and the output is worst, sometimes erroneous...
我搜索了在这里,但没有发现任何有用的信息。有什么帮助吗?
I searched here but didn't find anything useful. Any help?
推荐答案
pub运行bin_executable.dart
运行 pub
和 pub
启动一个新进程,该进程运行 dart bin_executable.dart
pub run bin_executable.dart
runs pub
, and pub
starts an new process that runs dart bin_executable.dart
最近有一项更改,允许 pub
运行 bin_executable.dart
在新的Dart隔离中,而不是新的过程中。这样做可能会更快一些,但我认为主要目的是允许附加调试器,以便在与 pub运行时调试
(特别是用于 bin_executable.dart
。 pub运行测试
)
There was a recent change that allows pub
to run bin_executable.dart
in a new Dart isolate instead of a new process. That might make it a little faster but I think the main purpose is to allow to attach a debugger to debug bin_executable.dart
when run with pub
(especially for pub run test
)
我认为主要部分或执行速度较慢的是 pub
I assume the main part or the slower execution is the start time for pub
这篇关于“发布运行”与正常执行有何不同?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!