Streaming Rust

Rust さんぽ

Database Benchmark

database って色々あるけど何使えばいいの?

protocol 実装大会

どれくらい sha256 って早いの?

行列計算勝負 python numpy vs rust ndarray

  • BLAS とか使えば一緒?
  • mojo も参戦

Other tips

utoipa just serve the openapi.json

axum の 場合

pub fn api_doc() -> Json<utoipa::openapi::OpenApi> {


std::mpsc::Sender is !Sync (which means you need to wrap it with a Mutex or similar) where crossbeam::channel::Sender is Sync. Other than the perforance gains, seems like crossbeam is status quo.

accessing the tokio’s runtime from other threads

we don’t want multiple runtimes in one app.

use std::thread;

async fn main() {
    thread::spawn(move ||{

async fn async_function() {

but there might be situations that we want to fun async functions inside our dedicated thread.

in that case you get the handle of the runtime and use that

use tokio::runtime::Handle;

let handle = Handle::current();

handle.spawn(async move{

other small things

const or static

Almost always use const. I guess when const it lives in the binary, on the otherhand when it’s a static it has a memory assigned and could be modified through unsafe operations.

Date: 2023-08-03 Thu 14:08