Skip to content

Instantly share code, notes, and snippets.

#![allow(dead_code)]
use chrono::prelude::*;
use chrono::Duration;
use redux_rs::{Store, Subscription};
use std::boxed::Box;
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
struct State {
date: Date<Utc>,
test header_map order_map_fnv std_map_fnv order_map_seahash vec_map
get_100_std 623 613 393 1,511 2,628
get_10_custom_short 103 97 91 259 389
get_10_of_20_std 54 52 39 114 42
hn_hdrs_set_11_get_with_miss 774 739 771 1,062 735
hn_hdrs_set_8_get_many 664 680 701 912 470
hn_hdrs_set_8_get_miss 502 543 616 593 373
insert_100_custom_headers 6,331 5,924 14,043 6,900 28,461
insert_4_std_get_30 381 360 460 580 357
insert_500_custom_headers 30,174 26,153 54,672 32,465 568,644
test basic::get_100_std::header_map ... bench: 623 ns/iter (+/- 145)
test basic::get_100_std::order_map_fnv ... bench: 613 ns/iter (+/- 244)
test basic::get_100_std::order_map_seahash ... bench: 1,511 ns/iter (+/- 237)
test basic::get_100_std::std_map_fnv ... bench: 393 ns/iter (+/- 27)
test basic::get_100_std::vec_map ... bench: 2,628 ns/iter (+/- 147)
test basic::get_10_custom_short::header_map ... bench: 103 ns/iter (+/- 12)
test basic::get_10_custom_short::order_map_fnv ... bench: 97 ns/iter (+/- 13)
test basic::get_10_custom_short::order_map_seahash ... bench: 259 ns/iter (+/- 34)
test basic::get_10_custom_short::std_map_fnv ... bench: 91 ns/iter (+/- 10)
test basic::get_10_custom_short::vec_map ... bench: 389 ns/iter (+/- 32)
[package]
name = "pb"
version = "0.1.0"
authors = ["Matt Brubeck <mbrubeck@limpet.net>"]
edition = "2018"
[[bin]]
name = "pb"
path = "main.rs"
[package]
name = "foo"
version = "0.1.0"
authors = ["Matt Brubeck <mbrubeck@limpet.net>"]
edition = "2018"
[dependencies]
[build-dependencies]
smallvec = "0.6"
@mbrubeck
mbrubeck / lib.rs
Last active July 19, 2018 16:05 — forked from pftbest/lib.rs
#![feature(test)]
extern crate test;
trait Max2 {
type Item;
fn max_by_key2<B: Ord, F>(self, f: F) -> Option<Self::Item> where
Self: Sized,
F: FnMut(&Self::Item) -> B;
}
use itertools::zip;
use std::ops::{BitXor, BitXorAssign};
pub fn xor<T>(x: &[T], y: &[T]) -> Vec<T>
where T: BitXor<Output=T> + Copy {
zip(x, y).map(|(a, b)| *a ^ *b).collect()
}
pub fn xor_with<T>(x: &mut [T], y: &[T])
where T: BitXorAssign + Copy {
@mbrubeck
mbrubeck / main.rs
Last active May 22, 2018 16:36 — forked from Yatekii/main.rs
pub fn render(library: &Library, state: &mut State, mut stack: Vec<String>, expression: &mut Expression) -> Expression {
match expression {
// We have a symbolic expression that we have to evaluate
Expression::Symbolic(ref mut args) | Expression::NotDone(ref mut args) => {
// If we have a valid expression (unnamed ones are not allowed)
if args.len() > 0 {
// Get the first nested expression
return match args.remove(0) {
// If the first expression is a plain literal
Expression::Literal(Literal::S(name)) => {
armv7_unknown_cloudabi_eabihf cortex-a8
i686_apple_darwin yonah
i686_linux_android pentiumpro
i686_pc_windows_gnu pentium4
i686_pc_windows_msvc pentium4
i686_unknown_cloudabi pentium4
i686_unknown_dragonfly pentium4
i686_unknown_freebsd pentium4
i686_unknown_haiku pentium4
i686_unknown_linux_gnu pentium4
$ hg log -r FIREFOX_59_0_2_RELEASE..FIREFOX_59_0_3_RELEASE
changeset: 471206:239e434d6d2b
tag: FENNEC_59_0_2_BUILD1
tag: FENNEC_59_0_2_RELEASE
tag: FIREFOX_59_0_2_BUILD1
tag: FIREFOX_59_0_2_RELEASE
user: Vlad Baicu <vlad.baicu@softvision.ro>
date: Thu Mar 22 13:46:41 2018 -0700
summary: Bug 1444549 - Remove unused IconTabWidget XML attr. r=mcomella, a=RyanVM