Using perf:
$ perf record -g binary
$ perf script | stackcollapse-perf.pl | rust-unmangle | flamegraph.pl > flame.svg
NOTE: See @GabrielMajeri's comments below about the
-g
option.
Using perf:
$ perf record -g binary
$ perf script | stackcollapse-perf.pl | rust-unmangle | flamegraph.pl > flame.svg
NOTE: See @GabrielMajeri's comments below about the
-g
option.
sudo su | |
apt-get install -y autoconf automake libtool nasm make pkg-config | |
cd /tmp | |
wget https://github.com/mozilla/mozjpeg/releases/download/v3.1/mozjpeg-3.1-release-source.tar.gz | |
tar -xvf mozjpeg-3.1-release-source.tar.gz | |
cd mozjpeg | |
autoreconf -fiv | |
mkdir build && cd build | |
sh ../configure | |
make install |
{-# LANGUAGE TemplateHaskell #-} | |
{-# LANGUAGE TypeFamilies #-} | |
{-# LANGUAGE FlexibleInstances #-} | |
{-# LANGUAGE MultiParamTypeClasses #-} | |
{-# LANGUAGE DeriveFunctor #-} | |
import Control.Lens | |
import Prelude hiding (readFile, writeFile, print) | |
import qualified Prelude as Prelude(readFile, writeFile, print) |
Set Implicit Arguments. | |
Inductive Place | |
:= Kitchen | Bedroom | Hallway | Outside. | |
Inductive Card := NORTH | EAST | SOUTH | WEST. | |
Definition moveTo (p : Place) (c : Card) : option Place := | |
match p, c with |
The original code (~7.2s on my laptop).
import System.Random
import System.CPUTime
rainfall :: [Int] -> Int
rainfall xs = sum (zipWith (-) mins xs)
defmodule Examples do | |
def zero do | |
files = ["abc.json", "def.json", "ghi.json"] | |
contents = files | |
|> Enum.map(fn (file) -> | |
File.read(file) | |
end) | |
# => [{:ok, "..."}, {:error, :enoent}, {:ok, "..."}] |
(* A very simple Coq encoding of the "Towers of Hanoi" puzzle game. *) | |
Require Import Coq.Lists.List. | |
Import ListNotations. | |
Require Import Coq.Arith.Compare_dec. | |
(* Proof of a sorted list *) | |
Inductive Sorted : list nat -> Prop := | |
| sorted'nil : Sorted [] |
Flamegraphing in Rust can now be done with a new cargo
subcommand. Please check this out before embarking on the legacy journey below:
https://github.com/flamegraph-rs/flamegraph
perf
, using Brendan Gregg's guide:
http://www.brendangregg.com/perf.html#Prerequisitesflamegraph
from repo:A quadratic space is a real vector space V with a quadratic form Q(x), e.g. V = R^n with Q as the squared length. The Clifford algebra Cl(V) of a quadratic space is the associative algebra that contains V and satisfies x^2 = Q(x) for all x in V. We're imposing by fiat that the square of a vector should be the quadratic form's value and seeing where it takes us. Treat x^2 = Q(x) as a symbolic rewriting rule that lets you replace x^2 or x x with Q(x) and vice versa whenever x is a vector. Beyond that Cl(V) satisfies the standard axioms of an algebra: it lets you multiply by scalars, it's associative and distributive, but not necessarily commutative.
Remarkably, this is all you need to derive everything about Clifford algebras.
Let me show you how easy it is to bootstrap the theory from nothing.
We know Cl(V) contains a copy of V. Since x^2 = Q(x) for all x, it must also contain a copy of some nonnegative reals.
// This file is part of meshoptimizer library; see meshoptimizer.h for version/license details | |
#include "meshoptimizer.h" | |
#include <assert.h> | |
#include <float.h> | |
#include <math.h> | |
#include <string.h> | |
#ifndef TRACE | |
#define TRACE 0 |