Skip to content

Instantly share code, notes, and snippets.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@tizoc
tizoc / flamegraph_rust.md
Created April 29, 2021 02:21 — forked from dlaehnemann/flamegraph_rust.md
flamegraphing rust binaries' cpu usage with perf
@tizoc
tizoc / Profile Rust on Linux.md
Created April 29, 2021 02:21 — forked from KodrAus/Profile Rust on Linux.md
Profiling Rust Applications

Profiling performance

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.

diff --git a/console.js b/console.js
index 9f026d9..7d5b530 100644
--- a/console.js
+++ b/console.js
@@ -22,7 +22,9 @@ $(async function () {
//console.log(shen.valueOf("shen.*tc*"))
await shen.assign("*history*", 0)
await shen.exec("(define runsh Parsed -> (trap-error (shen.toplevel (read-from-string Parsed)) (/. E (shen.toplevel-display-exception E))))")
+ await shen.exec("(define input-parses? Str -> (let Chars (map (function string->n) (explode Str)) Parsed (compile (/. X (shen.<st_input> X)) Chars (/. E $$$input-incomplete)) (shen-script.boolean.shen->js (not (= Parsed $$$input-incomplete)))))")
let evalShen = await shen.caller("runsh")
"Copyright (c) 2010-2015, Mark Tarver
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
@tizoc
tizoc / init.scm
Created September 27, 2019 12:45
(define (kl:shen.initialise)
(begin
(kl:set 'shen.*installing-kl* #f)
(kl:set 'shen.*history* '())
(kl:set 'shen.*tc* #f)
(kl:set '*property-vector* (kl:shen.dict 20000))
(kl:set 'shen.*process-counter* 0)
(kl:set 'shen.*varcounter* (kl:vector 10000))
(kl:set 'shen.*prologvectors* (kl:vector 10000))
(kl:set 'shen.*demodulation-function* (lambda (X) X))
@tizoc
tizoc / 0-prenex.shen
Last active September 23, 2019 19:27
(define prenex*
{wff --> wff}
[~ [all X P]] -> [exists X [~ P]]
[~ [exists X P]] -> [all X [~ P]]
[[all X P] & Q] -> [all X [P & Q]]
[[exists X P] & Q] -> [exists X [P & Q]]
[P & [all X Q]] -> [all X [P & Q]]
[P & [exists X Q]] -> [exists X [P & Q]]
[[all X P] v Q] -> [all X [P v Q]]
[[exists X P] v Q] -> [exists X [P v Q]]
rc/iSpindel.cpp b/pio/src/iSpindel.cpp
index a3d92ee..062c7bb 100644
--- a/pio/src/iSpindel.cpp
+++ b/pio/src/iSpindel.cpp
@@ -79,6 +79,7 @@ char my_polynominal[70] = "-0.00031*tilt^2+0.557*tilt-14.054";
String my_ssid;
String my_psk;
+uint8_t my_wifi_timeout = 5;
uint8_t my_api;
@tizoc
tizoc / MailinatorAliases
Created September 5, 2018 14:10 — forked from nocturnalgeek/MailinatorAliases
A list of alternate domains that point to @mailinator.com
@binkmail.com
@bobmail.info
@chammy.info
@devnullmail.com
@letthemeatspam.com
@mailinater.com
@mailinator.net
@mailinator2.com
@notmailinator.com
@reallymymail.com
\* Aliases *\
(define dict Size -> (shen.dict Size))
(define dict? Dict -> (shen.dict? Dict))
(define dict-count Dict -> (shen.dict-count Dict))
(define dict-> Dict Key Value -> (shen.dict-> Dict Key Value))
(define <-dict Dict Key -> (shen.<-dict Dict Key))
(define dict-rm Dict Key -> (shen.dict-rm Dict Key))
(define dict-fold Dict F -> (shen.dict-fold Dict F))
(define dict-keys Dict -> (shen.dict-keys Dict))