This commit is contained in:
JT
2021-10-26 05:58:58 +13:00
parent baac60a5a7
commit 5d19017603
59 changed files with 125 additions and 140 deletions

View File

@ -2,8 +2,8 @@ use std::time::Instant;
use nu_engine::eval_block;
use nu_protocol::ast::Call;
use nu_protocol::engine::{Command, EngineState, EvaluationContext, Stack};
use nu_protocol::{PipelineData, Signature, SyntaxShape, Value};
use nu_protocol::engine::{Command, EngineState, Stack};
use nu_protocol::{PipelineData, Signature, SyntaxShape};
#[derive(Clone)]
pub struct Benchmark;
@ -39,7 +39,8 @@ impl Command for Benchmark {
let mut stack = stack.enter_scope();
let start_time = Instant::now();
eval_block(&engine_state, &mut stack, block, PipelineData::new())?;
eval_block(engine_state, &mut stack, block, PipelineData::new())?.into_value();
let end_time = Instant::now();
println!("{} ms", (end_time - start_time).as_millis());
Ok(PipelineData::new())

View File

@ -1,6 +1,6 @@
use nu_protocol::{
ast::Call,
engine::{Command, EngineState, EvaluationContext, Stack},
engine::{Command, EngineState, Stack},
Example, IntoPipelineData, PipelineData, ShellError, Signature, Value,
};
use sysinfo::{ProcessExt, System, SystemExt};

View File

@ -1,21 +1,15 @@
use std::borrow::Cow;
use std::cell::RefCell;
use std::collections::HashMap;
use std::env;
use std::io::{BufRead, BufReader, Write};
use std::process::{ChildStdin, Command as CommandSys, Stdio};
use std::rc::Rc;
use std::sync::mpsc;
use nu_protocol::engine::{EngineState, Stack};
use nu_protocol::{
ast::{Call, Expression},
engine::{Command, EvaluationContext},
ShellError, Signature, SyntaxShape, Value,
};
use nu_protocol::{IntoPipelineData, PipelineData, Span, Spanned, ValueStream};
use nu_protocol::{ast::Call, engine::Command, ShellError, Signature, SyntaxShape, Value};
use nu_protocol::{IntoPipelineData, PipelineData, Span, Spanned};
use nu_engine::{eval_expression, CallExt};
use nu_engine::CallExt;
const OUTPUT_BUFFER_SIZE: usize = 8192;

View File

@ -1,6 +1,6 @@
use nu_protocol::{
ast::Call,
engine::{Command, EngineState, EvaluationContext, Stack},
engine::{Command, EngineState, Stack},
Example, IntoPipelineData, PipelineData, ShellError, Signature, Span, Value,
};
use sysinfo::{ComponentExt, DiskExt, NetworkExt, ProcessorExt, System, SystemExt, UserExt};