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(no_core)] | |
#![no_core] | |
#![crate_type="rlib"] | |
#![feature(rustc_attrs)] | |
#![feature(fundamental)] | |
#![feature(lang_items)] | |
#![feature(intrinsics)] | |
#![feature(auto_traits)] | |
#![allow(non_camel_case_types)] |
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
// Results: | |
// | algorithm | Mixed | Odds first | Evens first | | |
// |-------------|-------|------------|-------------| | |
// |sort-split | 465us | 35us | 10us | | |
// |drain_filter | 26us | 24us | 22.5us | | |
// |retain-uninit| 17us | 21us | 19us | | |
// | |
// See also explanation on StackOverflow: https://stackoverflow.com/a/73005333/8195987 | |
#![feature(drain_filter)] |
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(const_type_id)] | |
use std::any::TypeId; | |
use std::mem::{size_of, align_of}; | |
pub trait IsUniqueTuple{ | |
const IS_UNIQUE: bool; | |
type ElementTypesArray; | |
const ELEMENT_TYPES_SORTED: Self::ElementTypesArray; | |
} |
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 criterion::{criterion_group, criterion_main, BenchmarkId, Criterion}; | |
use itertools::Itertools; | |
use std::convert::TryInto; | |
fn gen_numbers(size: u32) -> Vec<u32> { | |
use rand::prelude::Rng; | |
let mut rng = rand::thread_rng(); | |
let dist = rand::distributions::Uniform::new_inclusive(1u32, 10_000); | |
let size: usize = size.try_into().unwrap(); | |
(0..size).map(|_| rng.sample(dist)).collect() |
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
#![recursion_limit="512"] | |
// This script prints all cpu features which active in this build. | |
// There are 3 steps in usage of script: | |
// 1. get list of features using `rustc --print target-features` | |
// 2. put it into script (it has values actual for 2020-12-06 for x86-64 target). | |
// 3. run script. | |
fn pad_name(s: &str)->String{ | |
let mut res = s.to_string(); |
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
#include <atomic> | |
#include <cassert> | |
#include <iostream> | |
#include <list> | |
#include <memory> | |
#include <mutex> | |
#include <optional> | |
#include <thread> | |
#include <vector> |
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::cmp::{Ord, Ordering}; | |
use std::collections::HashMap; | |
use std::fmt::Debug; | |
use std::vec::Vec; | |
struct HeapEntry<TKey, TPriority> { | |
key: TKey, | |
priority: TPriority, | |
} |
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
http local | |
In 60.0000814 seconds we received 665953 responses and 0 errors | |
Mean 11099.201608749818 requests/sec | |
http remote | |
In 60.0109771 seconds we received 1224 responses and 0 errors | |
Mean 20.396268468689872 requests/sec | |
tcp nodelay local | |
In 60.0000037 seconds we received 3152850 responses and 0 errors |
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
#!/usr/bin/python3 | |
W_DIR = 'data/save' | |
BEGIN_PATTERN = 'region3' | |
ZIP_EXECUTABLE = 'C:/Program Files/7-Zip/7z.exe' | |
OUT_PUT_PATH = 'E:/Games/DF/Backups' | |
import os | |
import os.path | |
import subprocess |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
NewerOlder