This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import kotlinx.coroutines.* | |
| import kotlinx.coroutines.channels.produce | |
| import java.util.concurrent.atomic.AtomicInteger | |
| suspend fun getIdsFromService1(id: String): List<String> { | |
| return listOf("id1", "id2", "id3", "id4", "id5", "id6") | |
| } | |
| val concurrency2 = AtomicInteger(0) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package io.vertx.example; | |
| import io.vertx.core.AbstractVerticle; | |
| import io.vertx.core.Promise; | |
| import io.vertx.core.Vertx; | |
| import io.vertx.core.http.*; | |
| import java.util.concurrent.CountDownLatch; | |
| public class HttpClientBenchmark extends AbstractVerticle { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package io.vertx.example; | |
| import io.vertx.core.AbstractVerticle; | |
| import io.vertx.core.Promise; | |
| import io.vertx.core.Vertx; | |
| import io.vertx.core.http.*; | |
| import io.vertx.ext.web.client.HttpResponse; | |
| import io.vertx.ext.web.client.WebClient; | |
| import io.vertx.ext.web.client.WebClientOptions; | |
| import io.vertx.ext.web.codec.BodyCodec; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| use actix_web::{get, web, App, HttpServer, Responder}; | |
| #[get("/")] | |
| async fn index() -> impl Responder { | |
| "Hello, World! Hello, World! Hello, World! Hello, World! Hello, World! Hello, World! Hello, World! Hello, World! Hello, World! Hello, World! Hello, World! Hello, World! Hello, World! Hello, World! Hello, World! Hello, World! Hello, World! Hello, World! Hello, World! Hello, World! Hello, World! Hello, World! Hello, World! Hello, World! Hello, World! Hello, World! Hello, World! Hello, World! Hello, World! Hello, World! Hello, World! Hello, World! Hello, World! Hello, World! Hello, World! Hello, World! Hello, World! Hello, World! Hello, World! Hello, World! Hello, World! Hello, World! Hello, World! Hello, World! Hello, World! Hello, World! Hello, World! Hello, World! Hello, World! Hello, World! Hello, World! Hello, World! Hello, World! Hello, World! Hello, World! Hello, World! Hello, World! Hello, World! Hello, World! Hello, World! Hello, World! Hello, World! Hello, World! Hello, World! Hello, World! Hell |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class ParallelLimit { | |
| private static class Parallelizer<T> { | |
| private final LinkedList<Supplier<Future<T>>> pendingTasks; | |
| private final int limit; | |
| private final int totalTasks; | |
| private int concurrency; | |
| private final List<T> completedTasks = new ArrayList<>(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| I've forced cpus=2 for benchmark to be "fair" on bare metal. | |
| public static void main(String[] args) { | |
| Vertx vertx = Vertx.vertx(); | |
| int cpus = 2; //CpuCoreSensor.availableProcessors(); | |
| ============================================================================== | |
| bare metal - noProcessing |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Fatal Python error: Aborted | |
| Current thread 0x00007f70ba1e3740 (most recent call first): | |
| File "/opt/conda/lib/python3.8/site-packages/gunicorn/arbiter.py", line 357 in sleep | |
| File "/opt/conda/lib/python3.8/site-packages/gunicorn/arbiter.py", line 209 in run | |
| File "/opt/conda/lib/python3.8/site-packages/gunicorn/app/base.py", line 72 in run | |
| File "/opt/conda/lib/python3.8/site-packages/gunicorn/app/base.py", line 231 in run | |
| File "/opt/conda/lib/python3.8/site-packages/gunicorn/app/wsgiapp.py", line 67 in run | |
| File "/opt/conda/bin/gunicorn", line 8 in <module> | |
| Fatal Python error: Aborted |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package bfreuden | |
| import toothpick.InjectConstructor | |
| import toothpick.ProvidesSingleton | |
| import toothpick.ktp.KTP | |
| import toothpick.ktp.binding.bind | |
| import toothpick.ktp.binding.module | |
| import javax.inject.* | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package bfreuden | |
| import toothpick.InjectConstructor | |
| import toothpick.ProvidesSingleton | |
| import toothpick.ktp.KTP | |
| import toothpick.ktp.binding.bind | |
| import toothpick.ktp.binding.module | |
| import javax.inject.Named | |
| import javax.inject.Provider | |
| import javax.inject.Scope |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| #include <string.h> | |
| #include <stdlib.h> | |
| #include <netdb.h> | |
| #include <sys/types.h> | |
| #include <sys/socket.h> | |
| #include <arpa/inet.h> | |
| #include <time.h> | |
| #include <errno.h> |
NewerOlder