Use write_to_vec for profile data
This commit is contained in:
parent
e901ddee5e
commit
3d00a45a06
|
@ -26,7 +26,7 @@ rayon = { version = "1.10.0", optional = true }
|
||||||
rand = "0.8"
|
rand = "0.8"
|
||||||
ark-bls12-381 = "0.4.0"
|
ark-bls12-381 = "0.4.0"
|
||||||
divan = "0.1"
|
divan = "0.1"
|
||||||
pprof = { version = "0.13.0" }
|
pprof = { version = "0.13.0", features = ['protobuf-codec', 'protobuf', 'cpp' ]}
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = []
|
default = []
|
||||||
|
|
|
@ -263,6 +263,7 @@ pub mod test {
|
||||||
decode, verify_element_proof, FieldElement, PolynomialEvaluationDomain,
|
decode, verify_element_proof, FieldElement, PolynomialEvaluationDomain,
|
||||||
BYTES_PER_FIELD_ELEMENT,
|
BYTES_PER_FIELD_ELEMENT,
|
||||||
};
|
};
|
||||||
|
use pprof::protos::Message;
|
||||||
use rand::RngCore;
|
use rand::RngCore;
|
||||||
use std::ops::Div;
|
use std::ops::Div;
|
||||||
|
|
||||||
|
@ -472,7 +473,7 @@ pub mod test {
|
||||||
fn profile_full_encode_flow() {
|
fn profile_full_encode_flow() {
|
||||||
// use ~1MB worth of data
|
// use ~1MB worth of data
|
||||||
let data = rand_data(1024 * 1024 / DaEncoderParams::MAX_BLS12_381_ENCODING_CHUNK_SIZE);
|
let data = rand_data(1024 * 1024 / DaEncoderParams::MAX_BLS12_381_ENCODING_CHUNK_SIZE);
|
||||||
let domain = GeneralEvaluationDomain::new(4096).unwrap();
|
let domain = PolynomialEvaluationDomain::new(4096).unwrap();
|
||||||
let encoder = DaEncoder::new(DaEncoderParams::new(4096, true));
|
let encoder = DaEncoder::new(DaEncoderParams::new(4096, true));
|
||||||
|
|
||||||
let guard = pprof::ProfilerGuardBuilder::default()
|
let guard = pprof::ProfilerGuardBuilder::default()
|
||||||
|
@ -487,9 +488,9 @@ pub mod test {
|
||||||
let profile = report.pprof().unwrap();
|
let profile = report.pprof().unwrap();
|
||||||
|
|
||||||
let mut content = Vec::new();
|
let mut content = Vec::new();
|
||||||
profile.encode(&mut content).unwrap();
|
profile.write_to_vec(&mut content).unwrap();
|
||||||
std::io::Write::write_all(&mut file, &content).unwrap();
|
std::io::Write::write_all(&mut file, &content).unwrap();
|
||||||
println!("report: {}", &report);
|
println!("report: {:?}", &report);
|
||||||
}
|
}
|
||||||
Err(_) => {}
|
Err(_) => {}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue