Skip to content

Instantly share code, notes, and snippets.

View ktoso's full-sized avatar
🗻
Life is Study!

Konrad `ktoso` Malawski ktoso

🗻
Life is Study!
View GitHub Profile
package test
import org.openjdk.jmh.annotations._
import scala.collection.immutable.Stack
import scala.collection.mutable
/*
Benchmark Mode Cnt Score Error Units
TestBenchmark.stack_1000 thrpt 20 7.446 ± 0.338 ops/ms
[error] error: incompatible types: String cannot be converted to int
[error] /Users/ktoso/code/akka/akka-docs-dev/rst/java/code/docs/http/javadsl/LambdaRoutingExample.java:49: error: invalid method reference
[error] handleWith(x, y, this::multiply)
[error] ^
[error] static bound method reference
[error] /Users/ktoso/code/akka/akka-docs-dev/rst/java/code/docs/http/javadsl/LambdaRoutingExample.java:61: error: no suitable method found for handleWith(PathMatcher<Integer>,PathMatcher<Integer>,LambdaRout[...]Async)
[error] handleWith(xSegment, ySegment, LambdaRoutingExample::multiplyAsync)
[error] ^
[error] method BasicDirectivesBoilerplate.<T1#1>handleWith(RequestVal<T1#1>,Function2<RequestContext,T1#1,RouteResult>) is not applicable
[error] (cannot infer type-variable(s) T1#1
ktoso @ 月~/code/akka/akka-actor/target/classes [wip-ActorSelection-in-ALOD-ktoso*]
$ jol estimates -cp '.:/Users/ktoso/.ivy2/cache/org.scala-lang/scala-library/jars/scala-library-2.10.5.jar' akka.actor.ActorSelection
WARNING: Unable to attach Serviceability Agent. You can try again with super-user privileges. Use -Djol.tryWithSudo=true to try with sudo.
WARNING: VM details, e.g. object alignment, reference size, compressed references info will be guessed.
Running 64-bit HotSpot VM.
Using compressed oop with 3-bit shift.
Using compressed klass with 3-bit shift.
Objects are 8 bytes aligned.
kka-stream-tests-experimental > testOnly *TcpSpec*
[info] TcpSpec:
Coroner Thread Count starts at 15 in akka.stream.io.TcpSpec
[info] Outgoing TCP stream
[WARN] [07/07/2015 13:11:40.739] [TcpSpec-akka.actor.default-dispatcher-3] [akka://TcpSpec/user/$b] received dead letter from Actor[akka://TcpSpec/system/IO-TCP/selectors/$a/0#2045015129]: Unbound
[WARN] [07/07/2015 13:11:40.749] [TcpSpec-akka.actor.default-dispatcher-2] [akka://TcpSpec/system/IO-TCP/selectors/$a/1] received dead letter from Actor[akka://TcpSpec/deadLetters]: ChannelReadable
[info] - must work in the happy case (2 seconds, 417 milliseconds)
[info] - must be able to write a sequence of ByteStrings (272 milliseconds)
[info] - must be able to read a sequence of ByteStrings (399 milliseconds)
[WARN] [07/07/2015 13:11:41.582] [TcpSpec-akka.actor.default-dispatcher-2] [akka://TcpSpec/system/IO-TCP/selectors/$a/7] unhandled message from Actor[akka://TcpSpec/system/IO-TCP-STREAM/client-3-%2F127.0.0.1%3A50097#-231405531]: ResumeReading
bidProjection.latestOffset.foreach { startFromOffset =>
readJournal
.query(EventsByTag("bid", startFromOffset))
.mapAsync(8) { envelope => (writer ? envelope.event).map(_ => envelope.offset) }
.mapAsync(1) { offset => bidProjection.saveProgress(offset) }
.runWith(Sink.ignore)
/*
* Copyright (C) 2015 Typesafe Inc. <http://www.typesafe.com>
*/
package akka.actor
import java.util.concurrent.TimeUnit
import java.util.concurrent.atomic.AtomicInteger
import akka.routing.{NoRoutee, Routee}
import org.openjdk.jmh.annotations._
warn] /Users/ktoso/code/akka/akka-persistence/src/test/scala/akka/persistence/PersistentActorFailureSpec.scala:108: a type was inferred to be `Any`; this may indicate a programming error.
[warn] override def receiveRecover: Receive = failingRecover orElse super.receiveRecover
[warn] ^
[warn] one warning found
[info] Compiling 11 Scala sources to /Users/ktoso/code/akka/akka-bench-jmh/target/classes...
[warn] /Users/ktoso/code/akka/akka-bench-jmh/src/main/scala/akka/actor/ActorPathValidationBenchmark.scala:14: imported `Scope' is permanently hidden by definition of trait Scope in package actor
[warn] import org.openjdk.jmh.annotations.Scope
[warn] ^
[error] missing or invalid dependency detected while loading class file 'LeveldbIdMapping.class'.
[error] Could not access term iq80 in package org,
@ktoso
ktoso / SerializableLambdaMethodCodeSize.java
Last active August 29, 2015 14:21
`Java 1.8.0_25` is unable to compile a class with more than `449` **serializable** lambdas, because the `deserializeLambda` method grows too big.
import java.lang.FunctionalInterface;
import java.util.function.*;
import java.io.Serializable;
import java.util.function.Function;
public class SerializableLambdaMethodCodeSize {
@FunctionalInterface
public static interface MyFunction<I, O>
extends java.util.function.Function<I, O>,
validatePullRequest := Def.taskDyn {
val log = streams.value.log
val theVoid = Def.task { () }
if (projectIsAffectedByChanges.value) {
log.info(s"Changes in PR are affecting project [${name.value}] - proceeding with test:test")
theVoid.dependsOn(test in Test)
} else {
log.debug(s"Skipping validation of [${name.value}], as PR does NOT affect this project...")
theVoid
$ sbt shell
[info] Loading global plugins from /Users/ktoso/.sbt/0.13/plugins
[info] Loading project definition from /Users/ktoso/code/reactive-platform-tools/project
[info] Updating {file:/Users/ktoso/code/reactive-platform-tools/project/}reactive-platform-tools-build...
[info] Resolving com.typesafe.dbuild#deploy_2.10;0.9.3-M2 ...
[error] Unable to find credentials for [Bintray @ dl.bintray.com].
[warn] module not found: com.typesafe.dbuild#deploy_2.10;0.9.3-M2
[warn] ==== typesafe-ivy-releases: tried
[warn] https://repo.typesafe.com/typesafe/ivy-releases/com.typesafe.dbuild/deploy_2.10/0.9.3-M2/ivys/ivy.xml
[warn] ==== sbt-plugin-releases: tried