diff --git a/src/commands/table.rs b/src/commands/table.rs index 6f75b63747..1de2665a77 100644 --- a/src/commands/table.rs +++ b/src/commands/table.rs @@ -3,8 +3,10 @@ use crate::format::TableView; use crate::prelude::*; use nu_errors::ShellError; use nu_protocol::{Primitive, ReturnSuccess, Signature, SyntaxShape, UntaggedValue, Value}; +use std::time::Instant; -const STREAM_PAGE_SIZE: usize = 100; +const STREAM_PAGE_SIZE: usize = 1000; +const STREAM_TIMEOUT_CHECK_INTERVAL: usize = 100; pub struct Table; @@ -59,7 +61,8 @@ fn table(args: CommandArgs, registry: &CommandRegistry) -> Result = VecDeque::new(); - for _ in 0..STREAM_PAGE_SIZE { + let start_time = Instant::now(); + for idx in 0..STREAM_PAGE_SIZE { if let Some(val) = delay_slot { new_input.push_back(val); delay_slot = None; @@ -89,6 +92,15 @@ fn table(args: CommandArgs, registry: &CommandRegistry) -> Result= 1 { + break; + } + } } }