mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2026-10-05 19:28:25 +00:00
Adds `marmotBench` — the quartz half of a head-to-head against MDK's
`cgka-engine --bench group_lifecycle`, case for case: create_group/N,
join_welcome, send_app_message, ingest_app_message. Both sides exclude
transport crypto, run over in-memory storage, and keep setup outside the
measured window, so what is compared is the engine's own CPU cost.
Every row also reports BYTES ALLOCATED PER OPERATION, from the JDK's own
`ThreadMXBean` — no dependency added. Latency alone cannot answer "are we
avoiding GC": a JVM can win a microbenchmark and still hand the user a
dropped frame later. The counter is per-thread, so benchmark bodies run
inline via `runBlocking` rather than on a dispatcher, where the allocation
would go uncounted.
First results, same host, nothing else running:
operation MDK quartz ratio
create_group/1 3.61 ms 16.93 ms 4.7x slower 27 MB/op
create_group/8 9.93 ms 51.47 ms 5.2x slower 95 MB/op
create_group/32 31.64 ms 190.08 ms 6.0x slower 333 MB/op
join_welcome 4.77 ms 6.22 ms 1.3x slower 10 MB/op
send_app_message 4.28 ms 1.72 ms 2.5x FASTER 2.8 MB/op
So the steady-state path a user actually exercises — sending a message — is
already faster than the reference. The gap is concentrated in key-agreement
work, and a JFR allocation profile says exactly where: 93% of all allocation
samples are `long[]` from `Curve25519Field.mul/add/sub`, which return a
freshly allocated field element on every single field operation inside
255-iteration scalar-multiplication loops. That one shape explains both the
5x latency gap and the MB-per-op allocation.
The fix (in-place field ops over caller-supplied scratch) is left as its own
change so it can be verified against the RFC vectors on its own merits.
Note: MDK's `ingest_app_message` has no number here. Their bench binary
panics in `bench_deferred_outbound_preflight_matrix` (an assertion on peeler
attempts) before reaching it, and criterion's filter does not skip that
bench's fixture construction. Reporting the gap rather than inventing a
comparison.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016kCuA6tc4JQzHPCDd39GHq
49 lines
1.2 KiB
Kotlin
49 lines
1.2 KiB
Kotlin
pluginManagement {
|
|
repositories {
|
|
google {
|
|
content {
|
|
includeGroupByRegex("com\\.android.*")
|
|
includeGroupByRegex("com\\.google.*")
|
|
includeGroupByRegex("androidx.*")
|
|
}
|
|
}
|
|
mavenCentral()
|
|
gradlePluginPortal()
|
|
maven {
|
|
url = uri("https://jitpack.io")
|
|
content {
|
|
includeModule("com.github.UnifiedPush", "android-connector")
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
dependencyResolutionManagement {
|
|
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
|
|
repositories {
|
|
mavenLocal()
|
|
google()
|
|
mavenCentral()
|
|
maven { url = uri("https://jitpack.io") }
|
|
maven { url = uri("https://raw.githubusercontent.com/guardianproject/gpmaven/master") }
|
|
}
|
|
}
|
|
|
|
rootProject.name = "Amethyst"
|
|
include(":amethyst")
|
|
include(":nappletHost")
|
|
include(":benchmark")
|
|
include(":baselineprofile")
|
|
include(":quartz")
|
|
include(":geode")
|
|
include(":commons")
|
|
include(":quic")
|
|
include(":nestsClient")
|
|
include(":marmotQuic")
|
|
include(":desktopApp")
|
|
include(":cli")
|
|
include(":relayBench")
|
|
include(":marmotBench")
|
|
include(":quic-interop")
|
|
project(":quic-interop").projectDir = file("quic/interop")
|