程序的执行时间

程序的执行时间 程序的执行时间 = 程序的指令数 * 每条指令的平均时钟周期数(CPI) * 每个时钟周期的时间 程序的指令数 Instructions per Program 五个影响因素: 任务程序本

Introduction to Parallel Computing

overview 这是一个超算实验室的一篇关于并行计算的文章 Supercomputing / High Performance Computing (HPC) Using the world’s fastest and largest computers to solve large problems. The programmer is responsible for many of the details associated with data communication between processors. 程序员负责与处理器之间的数据通信

动态sized类型(DST)

Dynamically-Sized Types (DSTs) document 绝大多数情况下,Rust 编译器认为类型必须具有静态已知的Size大小,但是并不总是这样。 有一类特殊的类型:动态sized类型(DST

rust option

.unwrap_or(0) 1 2 3 4 5 let opt: Option<i32> = Some(3); let value = opt.unwrap_or(0); // 0 being the default let opt: Option<String> = Some("some value".to_owned()); let value = opt.as_deref().unwrap_or("default string"); https://stackoverflow.com/questions/31233938/converting-from-optionstring-to-optionstr 两者都在程序执行期间求值,并且可以是任意值。区别在于: 使用unwrap_or

diesel

document: https://diesel.rs/guides/getting-started/ https://www.rectcircle.cn/posts/rust-diesel/ install: 1 2 // 只安装pg依赖 cargo install diesel_cli --no-default-features --features postgres 配置文件 1 2 3 # echo DATABASE_URL=postgres://username:password@localhost/diesel_demo > .env echo DATABASE_URL=postgres://localhost/test?user=root&password=example > .env cargo.toml 目前只支持uuid 0.6 1 2 3 4 diesel = { version = "1.4.4", features = ["postgres", "numeric", "chrono", "uuid"] } bigdecimal = "0.0.14" chrono = "0.4"