Skip to content

Instantly share code, notes, and snippets.

View He-Pin's full-sized avatar
🎈
Playing Xenoblade 3

He-Pin(kerr) He-Pin

🎈
Playing Xenoblade 3
View GitHub Profile
@He-Pin
He-Pin / readme.md
Created October 12, 2022 17:01 — forked from lukestephenson/readme.md
zio-streams performance observations

Background

I'm a long time user of reactive streams in Scala. Originally with akka-streams, and then Monix Observable.

The transition from akka streams to Monix Observable I found pretty straight forward. I was motivated by wanting to use a lazy effect system, rather than working with scala.concurrent.Future.

More recently I've been considering fs2 and Zio Streams as an alternative to Monix Observable. This has largely been motivated by the fact that Monix doesn't have much ongoing development and is stuck on cats-effect 2.

I've not found the transition from Monix Observable to Zio Streams as easy as my earlier transition (from akka -> monix). While the ergonomics of the API are similar, performance characterics differ hugely.

Chunking

@He-Pin
He-Pin / ReactorNotWorking.java
Created March 12, 2019 14:26
ReactorNotWorking
package com.alibaba.wireless.process.message.single.impl;
import com.alibaba.wireless.utils.NamedPoolThreadFactory;
import com.taobao.wireless.ripple2.core.util.SaneRejectedExecutionHandler;
import org.reactivestreams.Subscriber;
import org.reactivestreams.Subscription;
import reactor.core.publisher.Flux;
import reactor.core.scheduler.Schedulers;
import java.io.IOException;
package com.alibaba.wireless.process.message.single.impl;
import com.alibaba.wireless.utils.NamedPoolThreadFactory;
import com.taobao.wireless.ripple2.core.util.SaneRejectedExecutionHandler;
import org.reactivestreams.Subscriber;
import org.reactivestreams.Subscription;
import reactor.core.publisher.Flux;
import reactor.core.scheduler.Schedulers;
import java.io.IOException;
@He-Pin
He-Pin / fpmax.scala
Created July 13, 2018 03:26 — forked from jdegoes/fpmax.scala
FP to the Max — Code Examples
package fpmax
import scala.util.Try
import scala.io.StdIn.readLine
object App0 {
def main: Unit = {
println("What is your name?")
val name = readLine()
Using:
* 8 threads
* 1024 concurrent connections
* run for 20 seconds
* 64 requests pipelined
## VERTX
norman@dev-linux:~/workspace/vertx-examples/src/main/java$ vertx run httpperf/PerfServer.java -instances 4
@He-Pin
He-Pin / GCMSender.scala
Created October 27, 2015 18:34 — forked from anonymous/GCMSender.scala
Part of server with the old akka (akka-typed version: https://gist.github.com/anonymous/28accfa8e5f3fe187c4d)
package app.actors
import akka.actor.{Actor, ActorLogging}
import argonaut._, Argonaut._
import infrastructure.GCM
import launch.RTConfig
import spray.client.pipelining._
import spray.http._
import spray.httpx.marshalling.Marshaller
@He-Pin
He-Pin / GCMSender.scala
Created October 27, 2015 18:33 — forked from anonymous/GCMSender.scala
A part of game server with akka-typed
package app.actors
import akka.event.Logging
import akka.http.scaladsl._
import akka.http.scaladsl.model.HttpHeader.ParsingResult
import akka.http.scaladsl.model._
import akka.stream.ActorMaterializer
import akka.typed.ScalaDSL._
import akka.typed._
import argonaut.Argonaut._
@He-Pin
He-Pin / Build.scala
Last active August 29, 2015 14:06 — forked from mauricio/Build.scala
import sbt._
import Keys._
object Build extends sbt.Build {
val unmanagedJars = TaskKey[Keys.Classpath]("unmanaged-jars")
unmanagedJars := {
Configuration.listUnmanaged( file(".").getAbsoluteFile )
}
import java.lang.Math.*;
public class Progressbar {
private int max;
private int current;
private String name;
private long start;
private long lastUpdate;
public Progressbar(int max, String name)

Step by step guide to setting up IDEA to write gatling simulations

Prerequisites:

Have [SBT plugin][sbt-plugin] installed

Begin

  • [Create a new project][create-project] in IDEA ( File > New Project ...)
    • Make sure you select a maven module