Profiling performance
Using perf:
$ perf record -g binary
$ perf script | stackcollapse-perf.pl | rust-unmangle | flamegraph.pl > flame.svg
NOTE: See @GabrielMajeri's comments below about the
-g
option.
Using perf:
$ perf record -g binary
$ perf script | stackcollapse-perf.pl | rust-unmangle | flamegraph.pl > flame.svg
NOTE: See @GabrielMajeri's comments below about the
-g
option.
Add the following method to Serializer
:
fn serialize_byte_array<const N: usize>(self, bytes: &[u8; N]) -> Result<Self::Ok, Self::Error> {
self.serialize_bytes(bytes)
}
#![feature(test)] | |
extern crate test; | |
use serde::{Serialize, Serializer}; | |
pub struct Bytes([u8; 16]); | |
pub struct Tuple([u8; 16]); |
use std::fmt; | |
use log::kv::{self, Source, value::{self, Fill}}; | |
use tracing::{Value, Field, field::{self, Visit}}; | |
#[doc(hidden)] | |
pub struct LogField<'kvs>(&'kvs Field, &'kvs dyn Value); | |
impl fmt::Debug for LogField<'_> { |
use std::path::PathBuf; | |
use std::process::Command; | |
use std::str; | |
let mut msbuild = PathBuf::from("msbuild"); | |
let check_msbuild = Command::new(msbuild) | |
.arg("--version") | |
.output() | |
.is_ok(); |
#![feature(unsize)] | |
use std::{ | |
any::TypeId, | |
marker::Unsize, | |
fmt, | |
}; | |
enum Dyn<'v, T: ?Sized, TStatic: ?Sized> | |
{ |
using System; | |
using System.Threading; | |
namespace PureDI | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
// Create the singletons once |
https://github.com/search?q=user%3AKodrAus+topic%3Aexample
Any example repositories I put together should turn up with a user:KodrAus topic:example
GitHub search query.
See this issue in Kestrel.
This is what I do from my OSX environment.
$ ./build.sh -x64 -checked -skiptests
There's subtlety involved in doing this so I've just dumped this out from another document in case I ever need to remember what they were in the future.
value::Visit
The Visit
trait can be treated like a lightweight subset of serde::Serialize
that can interoperate with serde
, without necessarily depending on it. It can't be implemented manually:
/// A type that can be converted into a borrowed value.