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
| #![feature(lang_items)] | |
| #![feature(alloc_error_handler)] | |
| #![no_std] | |
| pub mod another_module; | |
| extern crate alloc; | |
| use alloc::boxed::Box; | |
| use async_recursion::async_recursion; |
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
| import random | |
| from collections import Counter | |
| def roll(die_size, die_count): | |
| return (random.randint(1, die_size) for _ in range(die_count)) | |
| def is_good_roll(rolls, threshold): | |
| c = Counter(rolls) | |
| return any(x >= threshold for x in c.values()) |
This file has been truncated, but you can view the full file.
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
| fn main() { | |
| let nums_to_benchmark : Vec<(i64,i64,i64)> = vec![(49678, 2494304, 7747),(38317, 544696, 43415),(6138, 2659002, 29553),(2761, 338174, 19280),(16260, 78580, 24388),(7576, 3054594, 37834),(32334, 4008762, 19146),(22045, 3207579, 33318),(42883, 487804, 40486),(18995, 509658, 14608),(15182, 1631279, 24483),(49246, 181390, 8540),(9158, 903907, 12252),(7215, 739887, 48418),(7347, 479129, 20363),(33335, 1497364, 34157),(33863, 4825516, 37049),(13283, 3981839, 42750),(7280, 2323910, 29865),(49897, 3384470, 24753),(11419, 1855585, 23851),(10664, 3490976, 21358),(9915, 1636069, 29726),(26380, 1180405, 11148),(42070, 3515997, 35383),(35350, 154947, 17576),(26585, 2964227, 32090),(27540, 1234725, 19336),(31423, 429598, 37633),(23281, 3820176, 12618),(45460, 2454214, 39841),(31879, 2542761, 26047),(47494, 5023626, 27881),(1993, 1528222, 13698),(10235, 2261742, 29463),(35487, 4672382, 18952),(16893, 1172318, 48633),(40461, 3312564, 22174),(22129, 2208894, 26222),(17775, 1236585, 22282),(22497, 3840819, 2334 |
This file has been truncated, but you can view the full file.
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
| fn main() { | |
| let nums_to_benchmark : Vec<(i32,i32,i32)> = vec![(49678, 2494304, 7747),(38317, 544696, 43415),(6138, 2659002, 29553),(2761, 338174, 19280),(16260, 78580, 24388),(7576, 3054594, 37834),(32334, 4008762, 19146),(22045, 3207579, 33318),(42883, 487804, 40486),(18995, 509658, 14608),(15182, 1631279, 24483),(49246, 181390, 8540),(9158, 903907, 12252),(7215, 739887, 48418),(7347, 479129, 20363),(33335, 1497364, 34157),(33863, 4825516, 37049),(13283, 3981839, 42750),(7280, 2323910, 29865),(49897, 3384470, 24753),(11419, 1855585, 23851),(10664, 3490976, 21358),(9915, 1636069, 29726),(26380, 1180405, 11148),(42070, 3515997, 35383),(35350, 154947, 17576),(26585, 2964227, 32090),(27540, 1234725, 19336),(31423, 429598, 37633),(23281, 3820176, 12618),(45460, 2454214, 39841),(31879, 2542761, 26047),(47494, 5023626, 27881),(1993, 1528222, 13698),(10235, 2261742, 29463),(35487, 4672382, 18952),(16893, 1172318, 48633),(40461, 3312564, 22174),(22129, 2208894, 26222),(17775, 1236585, 22282),(22497, 3840819, 2334 |
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
| #![feature(async_await)] | |
| /* | |
| Cargo.toml dependencies: | |
| serde = { version = "1.0", features = ["derive"] } | |
| tokio = { git = "https://github.com/tokio-rs/tokio", default-features = false, features = ["io", "codec"] } | |
| tokio-postgres = { git = "https://github.com/sfackler/rust-postgres", branch = "std-futures" } | |
| futures-preview = { git = "https://github.com/rust-lang-nursery/futures-rs" , features = ["nightly", "async-await"] } | |
| futures-util-preview = { version = "0.3.0-alpha.4", features = ["compat"] } |
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 postgres::{Connection, TlsMode}; | |
| use std::error::Error; | |
| use serde::Deserialize; | |
| #[derive(Clone, Debug, Deserialize)] | |
| struct Person { | |
| name : String, | |
| data : Vec<u8>, | |
| } |