Implements:
- Basic in-memory blockchain
- Basic Proof of work
- Methods to serialize/deserialize complete chain
Again none of this is supposed to be production ready.
Slow network time in seconds (100Mbps): | |
LZ4/Write takes: 0.2853062963485718 | |
LZ4/Read takes: 0.3265376162528992 | |
QLZ/Write takes: 0.31065379858016967 | |
QLZ/Read takes: 0.4505005311965942 | |
ZSTD/Write takes: 0.1596823501586914 | |
ZSTD/Read takes: 0.2516604351997376 | |
ZLIB/Write takes: 0.3231374764442444 | |
ZLIB/Read takes: 0.2478048324584961 | |
UC/Write takes: 0.7657859945297241 |
class CoroutineDebouncer<K, V> constructor( | |
private val pendingBoard: ConcurrentMap<K, Deferred<V?>> | |
) { | |
/** | |
* Debounce given a `task` based upon given `id`. This prevents jobs with same IDs run in parallel. | |
* For subsequent callers get Deferred<V> of first (winning) coroutine. | |
* Once Deferred<V> completes it is remove from the board. | |
* | |
* @param id for uniquely identifying a task | |
* @param context under which given coroutine will be executed |
package luna.lib | |
import io.lettuce.core.RedisClient | |
import io.lettuce.core.RedisException | |
import io.lettuce.core.cluster.RedisClusterClient | |
import io.lettuce.core.cluster.api.sync.RedisClusterCommands | |
import org.jgroups.Address | |
import org.jgroups.annotations.MBean | |
import org.jgroups.annotations.Property | |
import org.jgroups.conf.ClassConfigurator |
Here are some benchmarks of JDK 17 GCs. I wanted to compare a basic service running on Vert.x fetching and stream (HTTP chuncked transfer) 500 rows, serializing them to JSON (almost 30KB when serialized), send them over wire (buffered). Here are tech specs of this benchmarks:
MIT License
Copyright (c) 2022 Zohaib Sibte Hassan
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
Set of Deno scripts with some powerful toolbelt scripts for Redis
MIT License
Copyright (c) 2022 Zohaib Sibte Hassan
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
/.git |