This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trait BitStorage { | |
fn set(&mut self, index: usize, value: bool); | |
} | |
impl BitStorage for u8 { | |
fn set(&mut self, index: usize, value: bool) { | |
*self |= (value as u8) << index | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::io::stdin; | |
use std::io::Read; | |
use std::rc::Rc; | |
use std::cell::RefCell; | |
use std::cmp::max; | |
#[derive(Debug, Copy, Clone)] | |
struct Position(u16, u16); | |
impl Position { | |
fn adjacent(&self, other: &Position) -> bool { | |
max((self.0 as i16 - other.0 as i16).abs(), (self.1 as i16 - other.1 as i16).abs()) <= 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
VM SIZE FILE SIZE | |
-------------- -------------- | |
80.1% 971Ki [None] 4.06Mi 94.5% | |
3.6% 43.4Ki /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/src/jemalloc/src/ 43.4Ki 1.0% | |
2.7% 32.3Ki /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/src/jemalloc/src/ 32.3Ki 0.7% | |
2.7% 32.2Ki /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/src/jemalloc/src/ 32.2Ki 0.7% | |
1.7% 20.8Ki /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/src/libbacktrace/ 20.8Ki 0.5% | |
1.3% 16.1Ki /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/src/jemalloc/src/ 16.1Ki 0.4% | |
1.2% 14.9Ki /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/src/jemalloc/src/ 14.9Ki 0.3% | |
1.1% 13.0Ki /b |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
impl<T: Transport> BufferedTransport<T> { | |
fn get_bytes(&mut self) -> io::Result<&[u8]> { | |
if self.rpos == self.rbuf.len() { | |
self.rpos = 0; | |
self.rcap = try!(self.underlying.read(&mut self.rbuf)); | |
} | |
Ok(&self.rbuf[self.rpos..self.rcap]) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7:libstd/collections/hash/set.rs: where T: Borrow<Q>, | |
8:libstd/collections/hash/set.rs: where T: Borrow<Q>, | |
9:libstd/collections/hash/set.rs: where T: Borrow<Q>, | |
10:libstd/collections/hash/set.rs: where T: Borrow<Q>, | |
11:libstd/collections/hash/map.rs: where K: Borrow<Q>, | |
12:libstd/collections/hash/map.rs: where K: Borrow<Q>, | |
13:libstd/collections/hash/map.rs: where K: Borrow<Q>, | |
14:libstd/collections/hash/map.rs: where K: Borrow<Q>, | |
15:libstd/collections/hash/map.rs: where K: Borrow<Q>, | |
16:libstd/collections/hash/map.rs: where K: Borrow<Q>, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<table border=1> | |
<tr><td>A</td><td rowspan=0>B</td><td>C</td></tr> | |
<tr><td>D</td><td>D</td></tr> | |
<tr><td>E</td><td>F</td><td>G</td> | |
</table> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Unaltered string Jamo: ᄒ | |
Extended Grapheme Clusters for Jamo: ["ᄒ"] | |
Grapheme Clusters for Jamo: ["ᄒ"] | |
Unicode Scalars for Jamo: ['ᄒ', 'ᅡ', 'ᆫ'] | |
Unaltered string Devanagri word 'grapheme': ग्राफिम | |
Extended Grapheme Clusters for Devanagri word 'grapheme': ["ग्", "रा", "फि", "म"] | |
Grapheme Clusters for Devanagri word 'grapheme': ["ग्", "र", "ा", "फ", "ि", "म"] | |
Unicode Scalars for Devanagri word 'grapheme': ['ग', '्', 'र', 'ा', 'फ', 'ि', 'म'] | |
Unaltered string Devanagri letter 'gra': ग्रा | |
Extended Grapheme Clusters for Devanagri letter 'gra': ["ग्", "रा"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
test environment | |
rustc 1.16.0-nightly (5d994d8b7 2017-01-05) | |
Thinkpad X1 Carbon Touch (2012) | |
Intel(R) Core(TM) i7-3667U CPU @ 2.00GHz | |
cpufreq-set -g performance | |
no other programs running | |
all results are after one run to warm up the cache | |
regex | |
opt-level = 3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bench: libauthz.so | |
python2 main.py | |
libauthz.so: rusty_authz.rs Makefile | |
rustc -C opt-level=3 -C lto rusty_authz.rs --crate-type cdylib -o libauthz.so | |
.PHONY: bench |