Skip to content

Instantly share code, notes, and snippets.

View KeenS's full-sized avatar

κeen KeenS

View GitHub Profile
@KeenS
KeenS / memo.txt
Last active December 21, 2019 12:10
Rustの並列コンパイラを試してみた See also https://qiita.com/qnighy/items/b0aa66749ad7a31ecbf9
手元のコード(4万行くらい)をThreadripper 1950x(16コア32スレッド)でビルドしてみた
# 並列化してないやつ
cargo +nightly-2019-12-17 build 882.25s user 49.92s system 468% cpu 3:19.16 total
cargo +nightly-2019-12-17 build --release 2988.11s user 52.70s system 1149% cpu 4:24.54 total
cargo +nightly-2019-12-17 check 199.58s user 14.22s system 413% cpu 51.731 total
# 並列化したやつ
cargo +nightly-2019-12-18 build 1061.89s user 75.08s system 618% cpu 3:03.70 total
cargo +nightly-2019-12-18 build --release 3135.03s user 74.32s system 1247% cpu 4:17.21 total
functor Hamt(X:
sig
eqtype k
val hash: k -> Int32.int
end
): sig
type 'v t
exception HashConflict
val empty: 'v t
use std::ops::{Index, IndexMut};
pub struct User {
id: u64,
name: String,
}
impl User {
pub fn new(id_var: u64, name_var: String) -> Self {
User {
@require: stdjareport
@import: stage0
let-inline \show-int n = embed-string (arabic n)
in
document (|
title = {サンプル文書};
author = {組 版太郎};
|) '<
[| x |] = λk.k x ・・・val
[| λx.t |] = λk.k (λx.[|t|]) ・・・lam
[| π t |] = λk.[|t|] (λa.k (π a)) ・・・app1
[| t1 t2 |] = λk.[|t1|] (λf.[|t2|] (λa.f a k)) ・・・app2
[| Sx.t |] = λk.[x↦λa.λk'.k' (k a)]([|t|] (λv.v))・・・shift
[| <t> |] = λk.k ([|t|] (λv.v)) ・・・reset
変換対象: <add10 (Sx.x (x 100))>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
# coding: utf-8
var = [
{ "id": "hello", "title": "Hello World", "children": [
{ "id": "comment", "title": "コメント", "children": nil },
{ "id": "print", "title": "フォーマットしてプリント", "children": [
{ "id": "print_debug", "title": "デバッグ", "children": nil },
{ "id": "print_display", "title": "ディスプレイ", "children": [
{ "id": "testcase_list", "title": "テストケース: リスト", "children": nil }
] },
{ "id": "fmt", "title": "フォーマット", "children": nil }
running 3 tests
test bench::benth_fib_memo1 ... bench: 5,237 ns/iter (+/- 411)
test bench::benth_fib_memo1_2 ... bench: 2 ns/iter (+/- 0)
test bench::benth_fib_memo2 ... bench: 2 ns/iter (+/- 0)
test result: ok. 0 passed; 0 failed; 0 ignored; 3 measured; 0 filtered out
//! parent level doc comments
mod path {
/*! parent level doc comment2 */
pub mod name {
pub type Type = String;
pub const CONSTANT: &'static str = "const";
}
}
struct DbConn;
#[derive(Clone, Copy)]
struct User;
#[derive(Clone, Copy)]
struct Device;
enum Error {
ReadPrivilege,
WritePrivilege,