Skip to content

Instantly share code, notes, and snippets.

@brson
brson / gist:299cb0762e5062e99678
Last active August 29, 2015 14:02
Servo parallel rendering
Servo + parallel rendering, 4 cores
# CPU mode, en.wikipedia.org/wiki/Rust
before: RenderingCategory: 108.3725 102.9995 2.7500 280.4812 91
after: RenderingCategory: 85.5513 87.8209 3.6918 149.5089 121
# GPU mode, en.wikipedia.org/wiki/Rust
before: RenderingCategory: 383.4462 308.6807 151.7053 840.7829 22
after: RenderingCategory: 338.4899 360.0376 90.4928 586.7247 54
@brson
brson / gist:9151fad931ec65a41129
Last active August 29, 2015 14:02
Perf comparison with 0ecd9e0 (Jan 29, 2013)
# msgsend-pipes
## old
Count is 100000000
Test took 2.01600541 seconds
Throughput=496030.415413 per sec
## new
@brson
brson / gist:cc3475abfb1eddff11ec
Last active August 29, 2015 14:02
Blog post notes
https://gist.github.com/nikomatsakis/7d803362efd180773290
https://gist.github.com/nikomatsakis/f6d4f95daaac3825e171
11:37 <nmatsakis> ping
11:41 <brson> pong
11:42 <nmatsakis> I was talking to Azita
11:43 <nmatsakis> she said that it's prob not necessary to have Rust blog post prepared before I leave,
11:43 <nmatsakis> but it would be good to summarize a few upcoming posts to give list to anreas,
11:43 <nmatsakis> *Andreas,
11:43 <nmatsakis> so I am going to prepare such a list with some ideas i've had and e-mail it out
@brson
brson / gist:a4d72e78f8d2372b65c1
Last active August 29, 2015 14:02
Commonly used API's in Rust
This uses my instrumented branch[1] to get a rough idea of the most commonly used cross-crate API's in mainline Rust, filtering out the syntax crate.
[1]: http://github.com/brson/rust/tree/xyx
36135 core::fmt::rt::Piece
27461 core::result::Result
27046 core::option::Option
23442 core::fmt::rt::Count
11721 core::fmt::rt::Position
11721 core::fmt::rt::FormatSpec

Use the "Rust" Vidyo room, extension 8445. There's currently no PIN required for access.

For external callers, we use the Vidyo conferencing system, which can be accessed either via their Flash-based application or phone. I strongly recommend using the app so people can see you.

For video access follow this link, after which you should be prompted to download the application:

https://v.mozilla.com/flex.html?roomdirect.html&key=7erw95PzutXx

For phone access:

brian@brian-ThinkPad-X1-Carbon:~/dev/mygame⟫ cargo build --verbose
Compiling gl v0.0.1 (https://github.com/bjz/gl-rs)
Compiling sdl2 v0.0.1 (https://github.com/AngryLawyer/rust-sdl2)
Compiling piston v0.0.0 (https://github.com/pistondevelopers/piston/)
Executing `git rev-parse master` failed
Caused by:
Executing `git rev-parse master` failed
Caused by:
Updating git repository `https://github.com/pistondevelopers/piston/`
5:cargo::sources::git::source: updating git source `GitRemote { location: https://github.com/pistondevelopers/piston/ }`
DEBUG:cargo::sources::git::utils: Executing git clone https://github.com/pistondevelopers/piston/ /home/brian/.cargo/git/db/_empty-0fda1a454dd9ee3f --bare --no-hardlinks --quiet
@ /home/brian/.cargo/git/db
DEBUG:cargo::sources::git::utils: Executing git rev-parse master @ /home/brian/.cargo/git/db/rust-graphics-56c2c5fe9b5f4304
5:cargo::ops::cargo_rustc: old fingerprint: 2e6b483c6d6998c3
5:cargo::ops::cargo_rustc: new fingerprint: 2e6b483c6d6998c3
Fresh graphics v0.0.0 (https://github.com/pistondevelopers/rust-graphics)
DEBUG:cargo::ops::cargo_rustc: compile_pkg; pkg=opengl_graphics v0.0.0 (https://github.com/pistondevelopers/opengl_graphics); targets=[LibTarget([Lib])(name=opengl_graphics, path=src/lib.rs), LibTarget([Lib])(name=opengl_graphics, path=src/lib.rs)]
5:cargo::sources::path: new; id=https://github.com/PistonDevelopers/rust-graphics
5:cargo::sources::path: new; id=https://github.com/PistonDevelopers/rust-image
5:cargo::sources::path: new; id=https://github.com/bjz/gl-rs
5:cargo::sources::path: new; id=https://github.com/pistondevelopers/opengl_graphics
DEBUG:cargo::sources::git::utils: Executing git rev-parse master @ /home/brian/.cargo/git/db/rust-graphics-4a1960bd953ebe6f
impl Game for App {
fn render(&mut self, args: &RenderArgs) {
self.gl.viewport(0, 0, args.width as i32, args.height as i32);
let ref c = Context::abs(args.width as f64, args.height as f64);
let c = c.rect(0.0, 0.0, args.width as f64, args.height as f64);
let c = c.rgb(0.0, 1.0, 1.0);
c.draw(&mut self.gl);
let c = c.rect(0.0, 0.0, 10.0, 10.0);
let c = c.rgb(1.0, 1.0, 1.0);
c.draw(&mut self.gl);