Your Android phone and your Windows PC, working as one. Local-first, end-to-end encrypted, no account.
NectarLink Performance Budgets & Measurements
This document records the release performance budgets, root-cause regression audits, and measured BEFORE/AFTER results across the Windows Desktop app (nectarlink-desktop), the Rust core engine (nectarlink-core), and the Android companion app (app.nectarlink.android).
1. Summary of Budgets vs. Measured Results
| Metric | Target Budget | Measured Result | Status |
|---|---|---|---|
| Desktop Cold Start to Window | < 800 ms |
310 ms to 424 ms (process launch to QML first frame interactive) |
PASS |
Desktop Start Minimized (--minimized) |
< 400 ms |
145 ms (process launch to tray icon ready, no QML window realized) |
PASS |
| Desktop Idle CPU (Window Closed / Tray) | < 0.2% |
0.00% (0.000s CPU delta over 15s steady-state window) |
PASS |
| Desktop Idle CPU (Window Open on Home, Glass + Island) | < 0.5% |
0.039% total CPU (0.47% single-core over 10s steady-state window) |
PASS |
| Desktop Working Set Memory (Window Closed / Tray) | < 50 MB |
14.2 MB private working set (WorkingSet64) |
PASS |
| Desktop Working Set Memory (Window Open, Glass + Island) | < 170 MB |
165.32 MB WS / 137.34 MB Private (down from 205.36 MB WS / 174.58 MB Private) |
PASS |
| Desktop 20-Step Window Resize CPU | < 350 ms CPU |
296.9 ms CPU (635 ms wall) (down from 421.9 ms CPU; -29.6% CPU, 0 QML binding loops) |
PASS |
Command Palette (Ctrl+Alt+Space) Open Time |
< 30 ms |
8.4 ms (popup open + initial action list filter) |
PASS |
| Screen Mirror End-to-End Latency (USB / LAN) | < 45 ms |
22 ms to 31 ms (60 fps H.264 hardware encode/decode over QUIC) |
PASS |
PC-to-Phone Speaker Audio Latency (PcAudio) |
< 40 ms |
22 ms to 36 ms (10 ms WASAPI loopback chunk + QUIC stream + AudioTrack PERFORMANCE_MODE_LOW_LATENCY) |
PASS |
| 4 GiB File Transfer + Pause/Resume + BLAKE3 | < 180 s in test |
16.0 s transfer with two mid-stream pauses and .part offset resumes, then 1.74 s full BLAKE3 verification (release build) |
PASS |
Android Cold Start (MainActivity) |
< 1,000 ms |
479 ms to 750 ms (TotalTime via am start -W, down from 1,566 ms to 2,291 ms) |
PASS |
Android Warm Start (MainActivity) |
< 100 ms |
14 ms to 30 ms (WaitTime via am start -W, down from 81 ms to 91 ms) |
PASS |
Android Memory (dumpsys meminfo app.nectarlink) |
< 110 MB PSS |
75.66 MB to 86.48 MB PSS (228.0 MB to 236.8 MB RSS) (down from 115.9 MB to 123.5 MB PSS) |
PASS |
| Android Idle Background Battery Impact (1 hr connected) | < 1.0% / hr |
0.18% / hr est. (0.2% to 0.6% idle CPU; event-driven callbacks; zero wake-lock leaks) |
PASS |
2. Performance Pass: Before and After Measurements, and Root Causes Fixed
2.1 Android (app.nectarlink on an Android emulator, physical phone not connected during this run)
| Metric | BEFORE (ebe0012 post-redesign baseline) |
AFTER (with all §1 & §2 fixes) | Improvement |
|---|---|---|---|
Cold Start (am start -W TotalTime) |
1,566 ms to 2,291 ms (8,973 to 10,273 ms right after AVD boot) |
479 ms to 750 ms (WaitTime: 483 ms to 762 ms) |
2.5× to 3.3× faster (< 1 s target met) |
Warm Start (am start -W WaitTime) |
81 ms to 91 ms |
14 ms to 30 ms |
3× to 5× faster |
Memory (TOTAL PSS / TOTAL RSS) |
115.9 MB to 123.5 MB PSS / 254.2 MB to 257.0 MB RSS |
75.66 MB to 86.48 MB PSS / 228.0 MB to 236.8 MB RSS |
-36.9 MB PSS (-30% to -36%) |
| Scroll Frame Pacing (Bloom HomeScreen, 5x up/down) | 27 ms / 61 ms / 77 ms (8.53% jank) |
17 ms / 18 ms / 18 ms / 19 ms (0.26% jank, 0.00% legacy, 1 / 383 frames) |
< 5% jank target met (-97% jank) |
| Scroll Frame Pacing (Bloom SettingsScreen, 5x up/down) | 27 ms / 61 ms / 77 ms |
17 ms / 18 ms / 19 ms / 19 ms (4.09% jank, 0.00% legacy, 15 / 367 frames) |
< 5% jank target met |
Scroll Frame Pacing (Liquid Glass, 50th / 90th / 95th / 99th) |
18 ms / 32 ms / 34 ms / 65 ms (10.44% jank) |
17 ms / 19 ms / 21 ms / 30 ms (6.91% legacy jank on AVD) |
90th -41%, 95th -38%, 99th -54% |
Scroll Frame Pacing (Graphite, 50th / 90th / 95th / 99th) |
n/a |
17 ms / 18 ms / 19 ms / 23 ms (2.65% legacy jank) |
< 5% jank target met |
Scroll Frame Pacing (AMOLED, 50th / 90th / 95th / 99th) |
n/a |
17 ms / 18 ms / 19 ms / 23 ms (4.56% legacy jank) |
< 5% jank target met |
Idle CPU (10s /proc/<pid>/stat delta) |
6 ticks (0.6% CPU) |
2 to 6 ticks (0.2% to 0.6% CPU) |
Up to 3x lower idle CPU |
Android Root Causes Identified & Fixed:
- Simultaneous Dual-Screen Composition & Full-Screen Hardware Layer (
MainActivity.kt):- Root Cause:
ScreenRoute.Mainpreviously kept bothHomeScreen(with allPcCardinstances, launchers, and sub-composables) andSettingsScreen(a 1,338-lineLazyColumnwith 30+ cards and switches) alive in the composition tree simultaneously inside aBoxusinggraphicsLayer { alpha = ... }(saveLayeroffscreen FBO allocation for the entire1080×2400screen). EveryCoreStateupdate recomposed both screens at once. - Fix: Replaced the dual-tree
BoxwithsaveableStateHolder.SaveableStateProvider(tab)+when (tab)so only the active tab (HomeorSettings) is in the composition tree while preserving scroll position across tab switches, and removed the full-screengraphicsLayer.
- Root Cause:
- Full-Screen
GlassBackdropRadial Gradient Overdraw (MainActivity.kt):- Root Cause: In Glass mode,
GlassBackdropdrew two full-screen overlappingBrush.radialGradientshaders across the entire1080×2400viewport behind every frame (~2.0× full-screen fragment shader overdraw before any card rendered). - Fix: Removed
GlassBackdropsoSurface(color = MaterialTheme.colorScheme.background)renders a clean single-pass background.
- Root Cause: In Glass mode,
- 10 Parallel
animateColorAsStateChannels onNectarlinkTheme(Theme.kt):- Root Cause: Every theme or artwork seed change ran 10 simultaneous
animateColorAsStatetween animations onColorSchemeroles, allocating a newColorSchemeand invalidating everyMaterialTheme.colorSchemereader across the entire UI tree on every frame for320 ms. - Fix: Used
targetSchemedirectly without per-frameColorSchemeallocation storms.
- Root Cause: Every theme or artwork seed change ran 10 simultaneous
- Multi-Pass
Modifier.liquidGlassCardOverdraw & White Top Highlight (Theme.kt,MainActivity.kt):- Root Cause:
Modifier.liquidGlassCardpreviously executed 3 separate draw passes per card (drawRoundRect(baseColor),drawRoundRect(topSheen),drawRoundRect(topLeftSpecular)) plus an asymmetric bright white top border (innerRimBrush), andModifier.glassModalBlurapplied a full-screenRenderEffect.createBlurEffect(18.dp)to the entireLazyColumnwhen a modal opened. - Fix: Simplified
Modifier.liquidGlassCardto a single flat fill pass + a single subtle uniform 1dp hairline border (outlineColor), removed the bright white top rim fromliquidGlassCardandFloatingDockTabPill, and madeModifier.glassModalBlura no-op.
- Root Cause:
- Cold-Start Main-Thread Binder IPC & JNI/Keystore Contention (
NectarlinkApplication.kt,Core.kt,SystemMonitors.kt,MainActivity.kt):- Root Cause:
NectarlinkApplication.onCreate()previously triggeredcore.start()synchronously beforeMainActivity.onCreate(), causing JNAlibnectarlink_ffi.soloading, Android Keystore IPC, SQLite initialization, andBroadcastReceiver/TelephonyCallbackregistrations onDispatchers.Mainto contend with first-frame rendering. - Fix: Deferred
core.start()viaChoreographer.getInstance().postFrameCallback(with a120 msheadless fallback), deferredSystemMonitorsreceiver/observer startup by48 ms, madeWifiManager.MulticastLockcreation lazy, deferred runtime permission prompts viawindow.decorView.post, and snapped immediately out ofScreenRoute.Startingwithout a200 mscrossfade.
- Root Cause:
- Bloom Theme
RenderNodeOutline Clipping &ActivityResultLauncherChurn During Scroll (HomeScreen.kt,SettingsScreen.kt,MainActivity.kt):- Root Cause: In
HomeScreen.kt, outer cardSurface(shape = MaterialTheme.shapes.extraLarge, ...)wrappers allocated hardwareRenderNodeoutline clips as cards entered the viewport, andPermissionsSetupCardregistered 4rememberLauncherForActivityResultDisposableEffects even when collapsed. InSettingsScreen.kt, the 5 Bloom color seed swatches usedSurface(shape = CircleShape)+Modifier.border(..., CircleShape)(5 clippedRenderNodes) andModifier.animateItemon every section. - Fix: Replaced outer card
Surfacewrappers inHomeScreen.ktwithColumn/Box+.liquidGlassCard(...)(drawWithCachesingle-pass rounded rect, zeroRenderNodeclip allocation), moved the 4rememberLauncherForActivityResulthooks insideif (expanded)inPermissionsSetupCard, replaced the 5 Bloom seedSurfaceswatches inSettingsScreen.ktwith adrawBehinddrawCircle+ stroke ring, and removedModifier.animateItemfromSettingsScreensections. Result on the emulator (release APK,Bloomtheme):HomeScreenjank dropped from8.53%to0.26%(1 / 383frames,0.00%legacy) andSettingsScreenjank is4.09%(15 / 367frames,0.00%legacy). (No physical phone was connected during this session.)
- Root Cause: In
2.3 Persistent Send Queue Idle CPU Overhead (nectarlink-desktop.exe)
Measured over a 10-second steady-state window on 12 logical cores (release build, window open on HomePage):
| State | 10s Process CPU Delta | Normalized Total CPU (12 cores) |
Working Set Memory | Notes |
|---|---|---|---|---|
Without a send queue (0 items waiting) |
0.078 s |
0.07% |
153.6 MB |
queue_notify awaits std::future::pending() when no items are waiting (zero background timers). |
With a send queue (3 items waiting in send_queue) |
0.062 s |
0.05% |
157.3 MB |
Event-driven tokio::sync::Notify + tokio::time::sleep_until next expiry/retry timestamp; zero polling loops. |
2.2 Windows Desktop (nectarlink-desktop.exe --data-dir <test-data-dir>)
| Metric | BEFORE (post-redesign baseline) | AFTER (with all §1 & §2 fixes) | Improvement |
|---|---|---|---|
Cold Start to Window (PC_WINDOW_OPEN_MS) |
723 ms |
424 ms |
-299 ms (41.4% faster) |
Working Set Memory (PC_MEMORY_WS_MB) |
205.36 MB |
165.32 MB |
-40.04 MB (-19.5%) |
Private Memory (PC_MEMORY_PRIVATE_MB) |
174.58 MB |
137.34 MB |
-37.24 MB (-21.3%) |
20-Step Window Resize (PC_RESIZE_20_STEPS) |
655 ms wall / 421.9 ms CPU (64.4% core) |
635 ms wall / 296.9 ms CPU (46.8% core) |
-125.0 ms CPU (-29.6%), 0 QML binding loops |
Hover + Scroll Burst (PC_HOVER_SCROLL_CPU_DELTA_MS) |
15.6 ms |
15.6 ms |
1 OS timer tick |
| Idle CPU (10s Window Open, Glass + Island) | 15.6 ms to 46.9 ms (0.013% to 0.039% total CPU) |
46.9 ms (0.039% total CPU / 0.47% single-core) |
Within < 0.5% budget |
Desktop Root Causes Identified & Fixed:
- 32+ Per-Card Software/FBO
CanvasInstances (Card.qml):- Root Cause:
Card.qmlpreviously instantiated aCanvas(glassRimCanvas) inside every singleCardacross the app (~32 cards onHomePageandSettingsPage) to paint a diagonal specular rim and top white highlight line. In Qt Quick, eachCanvasallocates its own backing texture and repaints on every width/height/theme change, causing severe texture reallocation stalls during window resize and scrolling. - Fix: Removed
glassRimCanvascompletely fromCard.qmland replaced it with a lightweight native scene-graphborderrectangle (border.width: 1, uniform subtle hairline).
- Root Cause:
- 4-Pass Nested FBO /
MultiEffectBlur Chain & 4s Poll Storm inNowPlaying(NowPlaying.qml,RoundedImage.qml,media.rs):- Root Cause:
NowPlaying.qmlusedlayer.enabled: true+MultiEffect(blurMax: 36) over aRoundedImagethat itself hadlayer.enabled: true+MultiEffect(maskEnabled: true) over aRectanglemask withlayer.enabled: true(4 nested offscreen GPU textures per media card!).- In
desktop/app/src/media.rs,PlayerView.atwas set toSystemTime::now()on everysnapshot()call, andmedia_sessions.rspolled GSMTC every 4 seconds (pos_msadvancing by 4000ms), causinglast_json != next_jsonto trigger a fullMediaBridgecxx-qtsignal emission, QML JSON re-parse, andNowPlayinglayout pass every 4 seconds even when idle!
- Fix:
- Replaced
NowPlaying.qml'sMultiEffectblur with a zero-FBOLinearGradientambient tint usingTheme.primaryContainer/Theme.secondaryContainer. - Replaced
RoundedImage.qml's 3-FBOMultiEffectmask chain with a singleOpacityMaskandsourceSizebound to physical pixel dimensions (Math.min(512, width * Screen.devicePixelRatio)). - Stabilized
PlayerView.atusing the actual pollSystemTimestored inLOCAL_PLAYERS, and addedplayers_meaningfully_changed()inmedia.rsso routine 4s GSMTC position advances (>1.5s expected delta) do not spam UI broadcasts while genuine track/state/user-seek changes broadcast immediately.
- Replaced
- Root Cause:
- Full-Window
MultiEffectBlur inMainWindow.qml& Eager Page Instantiation (HomePage.qml):- Root Cause:
MainWindow.qmlran aMultiEffect(blurMax: 52) overglassColorMesh, andHomePage.qmleagerly instantiated all non-Home subpages and ran aCanvas(batteryArcCanvas) inside the miniature phone illustration. - Fix: Replaced
glassColorMesh+MultiEffectwith a zero-FBO 3-stopLinearGradient, replacedbatteryArcCanvasinHomePage.qmlwith a hardware-acceleratedShape/ShapePath(PathAngleArc), and fixed theactiveMediaRowwidth binding loop during window resize.
- Root Cause:
3. Scale Benchmark Measurements (core/nectarlink-core/tests/scale_tests.rs)
The scale benchmarks move gigabytes and hold timing limits, so they are opt-in. Measured with a release build on Windows 11 x64 on 2026-10-14:
cargo test -p nectarlink-core --release --test scale_tests -- --ignored --nocapture
- 4 GiB file transfer with pause, resume and BLAKE3 (
scale_4gb_file_transfer_with_pause_resume_interruption_and_blake3)- Streams a 4 GiB (
4,294,967,296byte) file between two paired nodes over QUIC, pauses twice mid-stream (at 65 MiB and 102 MiB), resumes from the.partbyte offset each time, and verifies the full BLAKE3 digest. Transfer:16.0 s; verification:1.74 s. Limit in the test:180 s.
- Streams a 4 GiB (
- 10,000 notifications (
scale_10000_notifications_in_history_and_search)- Ingest:
13.8 ms. Listing a 200-item page:0.15 ms; search:2.43 ms. Limit:100 msfor list and search together.
- Ingest:
- 5,000 timeline entries and 200 chat threads (
scale_5000_timeline_entries_and_200_chat_threads)- Insert:
442 ms(timeline),105 ms(chats). Page query:0.89 ms; search:4.60 ms; thread list:0.37 ms; messages:0.06 ms. Limits:50 msper query,100 msfor search.
- Insert:
- 50 clipboard items of 64 KiB, encrypted (
scale_50_large_clips_encrypted_history)- Writing all 50 with DPAPI encryption:
3.06 s. Reopening, decrypting, listing and searching:182 ms. Limit:250 msin release builds.
- Writing all 50 with DPAPI encryption: