Skip to content

Instantly share code, notes, and snippets.

@ousado
ousado / test.rs
Created September 17, 2019 13:41
actix actors async response demo
use actix::prelude::*;
use actix_rt::spawn;
use futures::{prelude::*,Future, future};
use tokio_timer::Delay;
use std::time::{Duration,Instant};
struct Ping(usize);
impl Message for Ping {
type Result = Result<usize,()>;
package kp00
import scala.concurrent.duration._
import io.gatling.core.Predef._
import io.gatling.http.Predef._
import io.gatling.jdbc.Predef._
class RecordedSimulation extends Simulation {
In file included from /clean/projects/thirdparty/hl/src/hlc.h:26:0,
from fieldaccess.c:3:
/clean/projects/thirdparty/hl/src/hlc.h: In function ‘hl_null_access’:
/clean/projects/thirdparty/hl/src/hl.h:164:20: error: pasting "u" and ""Null access"" does not give a valid preprocessing token
# define USTR(str) u##str
^
/clean/projects/thirdparty/hl/src/hlc.h:61:15: note: in expansion of macro ‘USTR’
hl_error_msg(USTR("Null access"));
^
/clean/projects/thirdparty/hl/src/hl.h:164:20: error: ‘u’ undeclared (first use in this function)
@ousado
ousado / gist:ff1693e058c267b42c75269fa4a7b7f5
Created October 16, 2016 14:25
enum & call benchmarks
##################################
----------- CS/Mono -------------
##################################
Macro.hx:366:
┃ description ┃ ops/sec ┃ error ┃ samples ┃ performance ┃
┃━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┃━━━━━━━━━━━━┃━━━━━━━━┃━━━━━━━━━┃━━━━━━━━━━━━━┃
┃ E_N2_KP1_Int_SZ5_MIXAllCons ┃ 17,531,259 ┃ ±0.00% ┃ 10 ┃ 24% slower ┃
┃ E_N2_KP1_Int_SZ5_MIXFirstCon ┃ 17,498,854 ┃ ±0.42% ┃ 10 ┃ 24% slower ┃
┃ E_N2_KP1_Int_SZ5_MIXLastCon ┃ 17,434,401 ┃ ±0.64% ┃ 10 ┃ 24% slower ┃
┃ E_N2_KP1_Class_SZ5_MIXAllCons ┃ 22,450,994 ┃ ±0.66% ┃ 10 ┃ 3% slower ┃
```
##################################
----------- neko -------------
##################################
Bench2.hx:136: ------- iter ---------
Bench2.hx:137:
┃ description ┃ ops/sec ┃ error ┃ samples ┃ performance ┃
┃━━━━━━━━━━━━━┃━━━━━━━━━┃━━━━━━━━━┃━━━━━━━━━┃━━━━━━━━━━━━━┃
┃ list iter ┃ 1,986 ┃ ±1.52% ┃ 51 ┃ fastest ┃
┃ rlist iter ┃ 1,567 ┃ ±1.18% ┃ 49 ┃ 21% slower ┃
@ousado
ousado / Test.hx
Last active May 9, 2016 19:38
GADT typed Anons/Classes/
typedef DTag = Tag<Dynamic>; // kind of a defeat, but OK..
typedef Fruit = { tag: TagE<Fruit>, name: String, count: Int }
typedef Beverage = { tag: TagE<Beverage>, name: String, brand: String, liters: Float};
@:enum abstract TagE<T>(Int) {
var fruit: TagE<Fruit> = 1;
var beverage:TagE<Beverage> = 2;
}
typedef Tag<T> = { tag:TagE<T> };