Skip to content

Instantly share code, notes, and snippets.

View penso's full-sized avatar

Fabien Penso penso

View GitHub Profile
use criterion::{black_box, criterion_group, criterion_main, Criterion};
use rayon::prelude::*;
fn benchmark_distance_calculation(c: &mut Criterion) {
let mut group = c.benchmark_group("distance_group");
group.sample_size(20); // Reduce sample count
group.measurement_time(std::time::Duration::from_secs(22)); // Increase target time
group.bench_function("single thread", |b| {
b.iter(|| {
@penso
penso / icns.md
Created May 9, 2024 19:53
ICNS names
        month        | count 
---------------------+-------
 2022-12-01 00:00:00 | 35493
 2023-01-01 00:00:00 |  8099
 2023-02-01 00:00:00 |  2046
 2023-03-01 00:00:00 |  1717
 2023-04-01 00:00:00 |  1129
 2023-05-01 00:00:00 |  1014
 2023-06-01 00:00:00 |   267
@penso
penso / stargaze_names.md
Last active May 9, 2024 19:53
Stargaze Names Stats
month        | count 
---------------------+-------
 2022-11-01 00:00:00 |    24
 2022-12-01 00:00:00 | 12452
 2023-01-01 00:00:00 |  3168
 2023-02-01 00:00:00 |  1389
 2023-03-01 00:00:00 |   799
 2023-04-01 00:00:00 |   580
 2023-05-01 00:00:00 |   607
@penso
penso / dydx_events.txt
Created January 18, 2024 09:52
dydx mainnet event counts
count | event_name
-----------+-----------------------------
364035300 | rewards
364035300 | commission
65539708 | message
53670072 | tx
39112940 | coin_received
39111524 | coin_spent
39081890 | transfer
17029011 | match
@penso
penso / gist:81dcb2a114344426a30e1761f7617f99
Created December 2, 2023 14:47
stargaze_mainnet_messages.txt
Message Type Url | Count
------------------------------------------------------------------+----------
/cosmwasm.wasm.v1.MsgExecuteContract | 5751808
/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward | 4487825
/ibc.core.client.v1.MsgUpdateClient | 3647954
/cosmos.authz.v1beta1.MsgExec | 3478486
/ibc.core.channel.v1.MsgRecvPacket | 2634317
/cosmos.bank.v1beta1.MsgSend | 2570505
/ibc.core.channel.v1.MsgAcknowledgement | 1667149
/cosmos.staking.v1beta1.MsgDelegate | 1598838
@penso
penso / gist:1d58b97ce9a18349b90034ece792e819
Created December 2, 2023 14:24
stargaze_mainnet_events.txt
Event Name, Action | Count
------------------------------------------------------------------------------------+------------
("rewards", None) | 1349261124
("commission", None) | 1349261124
("coin_received", None) | 136287752
("coin_spent", None) | 127155648
("message", None) | 120622805
("transfer", None) | 108728720
("withdraw_rewards", None) | 19959940
("delegate", None) | 17252205
@penso
penso / tokio_closure.rs
Created June 6, 2023 09:21
How to use tokio + closure parameters
use futures::Future;
use std::sync::Arc;
use tokio::sync::Semaphore;
use tokio::task::JoinHandle;
#[tokio::main]
async fn main() -> Result<(), anyhow::Error> {
println!("Starting");
first(|count| async move {

Keybase proof

I hereby claim:

  • I am penso on github.
  • I am penso (https://keybase.io/penso) on keybase.
  • I have a public key ASCpVt9KtzTpS7hwTrOEHDA_me6wYmeGnr509miLRkb1Ewo

To claim this, I am signing this object:

@penso
penso / 0.log
Created February 9, 2022 11:00 — forked from rtyler/0.log
Playing around with syntax sugar around handling websocket messages
INFO otto_eventbus > Listening for WebSocket connections on 127.0.0.1:9311
DEBUG tungstenite::handshake::server > Server handshake done.
DEBUG otto_eventbus > Received: Ok(Text("{\"type\":\"ping\", \"value\" : {\"msg\":\"hi\"}}"))
INFO otto_eventbus > deser: Meow { ttype: "ping", value: Object({"msg": String("hi")}) }
DEBUG otto_eventbus > Handling: Ping { msg: "hi" }
DEBUG otto_eventbus > Received: Ok(Text("{\"type\":\"hello\",\"value\": null}"))
INFO otto_eventbus > deser: Meow { ttype: "hello", value: Null }
DEBUG otto_eventbus > Handling hello: Hello
@penso
penso / ChromeIsBad.sh
Last active December 13, 2020 14:52
ChromeIsBad.sh
#!/bin/sh
# Based on Loren finding https://chromeisbad.com/
# From https://apple.stackexchange.com/questions/92640/how-do-i-prevent-the-permissions-denied-message-from-being-displayed-when-i-do-a
find() {
{ LC_ALL=C command find -x "$@" 3>&2 2>&1 1>&3 | \
grep -v -e 'Permission denied' -e 'Operation not permitted' >&3; \
[ $? = 1 ]; \
} 3>&2 2>&1
}