Performance differences between spawn() and spawn_bash()
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 38/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- rust
- 領域
- cli, operating-systems
調査の方向性
まず、issue に記載された 2 つの Rust の例と timeout 値を使用して、spawn_bash()/execute() および spawn()/exp_string() で報告されたタイミングを再現します。PtyReplSession と PtySession のパスを比較し、コマンドが正常に完了することが設定された timeout に依存しないことを示す回帰テストのカバレッジを追加します。
索引モデルが issue の本文から書いたものです。
説明
Hello, this is perhaps not an issue, but I've been experimenting with the crate and notice the following behavior:
If I get a PtyReplSession with spawn_bash(Some(timeout)), and then use p.execute(command, ready), the time it takes for this to successfully return is directly related to timeout regardless of the time it actually takes command to reach ready. The higher the timeout, the longer it takes (but it returns Ok), and viceversa (though at a certain point, very small timeouts will fail to find ready).
If I get a PtySession with spawn(command, Some(timeout)), and then use p.exp_string(ready), the time it takes for this to successfully return is independent of timeout. I can change timeout as much as I want (as long as I don't make it too small), and the time to successfully return will remain constant. If ready is not found, the timeout works as expected.
I wouldn't expect the execution time of command to change when running in a PtySession vs a PtyReplSession. Could you explain why this happens? Is it a bug or am I missing something?
Example code with PtyReplSession:
let mut bash_session = spawn_bash(Some(10000))
.expect("session failed");
bash_session.execute("hostname", "mypc")
.expect("command failed");
Example code with PtySession:
let mut session = spawn("hostname", Some(10000))
.expect("session failed");
session.exp_string("mypc")
.expect("command failed");
Here are some test results:
Test: PtyReplSession with 2,000ms timeout:
running 1 test
test pruebas_rexpect::with_pty_repl_session_timeout_2000 ... ok
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 2.42s
Test: PtyReplSession with 10,000ms timeout:
running 1 test
test pruebas_rexpect::with_pty_repl_session_timeout_10000 ... ok
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 10.45s
Test: PtySession with 2,000ms timeout:
running 1 test
test pruebas_rexpect::with_pty_session_timeout_2000 ... ok
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.19s
Test: PtySession with 10,000ms timeout:
running 1 test
test pruebas_rexpect::with_pty_session_timeout_10000 ... ok
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.16s
- 主要言語
- Rust
- スター
- 391
- フォーク
- 69
- 平均マージ
- 1日 34分
- マージ済み PR(30日)
- 2
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
rust-cli/rexpect のほかの issue
-
難易度 4/5 3〜5日 初心者へのやさしさ 38/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 45/100
-
Configurable sleeps オープン
難易度 3/5 1〜2日 初心者へのやさしさ 48/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 25/100
rust-cli/rexpect の issue をすべて見る
似ている issue
-
Browser (wasm) relay client cannot connect to relays whose URL has a trailing-dot FQDN hostname オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
n0-computer/iroh#4550 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
paritytech/zombienet-sdk#591 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
farion1231/cc-switch#7638 · コメント 1 件 ·
-
onnx-ir re-exports ModelProto and GraphProto but not NodeProto, AttributeProto and AttributeType オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100