feat(performance): some improvements by reducing string allocations
This commit is contained in:
parent
6a68f4c710
commit
592eff8c74
2 changed files with 687 additions and 444 deletions
1103
src/terminal_pane.rs
1103
src/terminal_pane.rs
File diff suppressed because it is too large
Load diff
|
|
@ -33,8 +33,8 @@ impl Read for FakeStdinReader {
|
||||||
fn read(&mut self, buf: &mut [u8]) -> Result<usize, std::io::Error> {
|
fn read(&mut self, buf: &mut [u8]) -> Result<usize, std::io::Error> {
|
||||||
// ideally, we shouldn't have to sleep here
|
// ideally, we shouldn't have to sleep here
|
||||||
// stdin should be buffered and handled in the app itself
|
// stdin should be buffered and handled in the app itself
|
||||||
// ::std::thread::sleep(Duration::from_millis(50));
|
::std::thread::sleep(Duration::from_millis(50));
|
||||||
::std::thread::sleep(Duration::from_millis(100));
|
// ::std::thread::sleep(Duration::from_millis(100));
|
||||||
let read_position = self.input_chars.read_position;
|
let read_position = self.input_chars.read_position;
|
||||||
buf[0] = self.input_chars.content[read_position];
|
buf[0] = self.input_chars.content[read_position];
|
||||||
self.input_chars.set_read_position(read_position + 1);
|
self.input_chars.set_read_position(read_position + 1);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue