Repository navigation
Conversation
andre487
force-pushed
the
bench/compare-sing-box
branch
from
November 21, 2026 12:54
6a6cb6d to
18973b3
Compare
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add a manual Linux TUN comparison of the production MegaProxy core across nine proxy variants. Rebased on main with the QUIC receive-credit fix from #153. Build Go binaries with one toolchain and pinned GOST 3.3.0; original pairs use stable sing-box 1.14.4 (gvisor), while HTTP/2, HTTP/3 and CONNECT-UDP/MASQUE use pinned 1.15.0-alpha.13 (gvisor + QUIC), with explicit HTTP versions and fallback disabled. CONNECT-IP is outside this comparison.
Require iperf3 3.22.1 before setup, resolving one executable for client and server through Fastlane
iperf:PATH/ runner--iperf PATH. Record its version, path and SHA-256. Preserve process return codes and signal names. An unexpected fixture exit aborts without retries and retains partial samples, summary andcomplete: falsestatus identifying the fixture and exit cause. A completed matrix with failed workloads still exits nonzero withcomplete: true.HTTP/3 jump is excluded from both engines pending GOST's oversized-DATAGRAM fix. The exclusion/reason remains in metadata and the report. The error path still exists in go-gost/x v0.28.1 and the inspected master: MASQUE WriteTo, UDP relay. No diagnostic GOST patch is used.
Use private verified TLS/SSH identities, network namespaces, fixed CPU affinity and independent TUN/underlay MTUs (1400/1500). Each workload gets a fresh warmed core. Measure TCP upload/download, connection+echo, supported UDP, latency percentiles and core CPU/RSS at 1/8 streams. Host routes, trust stores and existing SSH service are untouched; credentials stay outside artifacts. Expose Fastlane lanes and synchronized EN/RU methodology; required CI has no performance thresholds.
Completed post-fix measurements
Clean commit 18973b3, Go 1.26.3, same dedicated 2-vCPU Linux VM, three samples, two measured seconds plus warm-up. 462/462 passed, including 30 direct controls; all 432 successful proxied measurements increased both TUN counters. No UDP packet loss was observed at an offered 20 Mbit/s total (1/8 streams). Exact runner and binary hashes are retained with raw JSON outside Git; previous pre-fix and diagnostic datasets are separate and not pooled.
Median single-stream TCP receiver goodput, upload/download, Mbit/s:
Profiling qualification
A separate anonymous-SOCKS5 experiment confirms different Linux TUN capabilities: kernel netlink reports
vnet_hdr=falsefor MegaProxy andtruefor stock sing-box. Forcing only sing-box's GSO option off selects the non-vnet/GRO/offload path and changes single-stream upload from 2290 to 710 Mbit/s; MegaProxy records 1075. Download changes from 920 to 640, versus MegaProxy's 237. These are single 15-second diagnostic samples with identical profiling hooks, not replacement medians for the table above. The original table compares Linux defaults, not equal offload capabilities or Android performance.Native reverse CPU profiling attributes 41.23% of CPU samples cumulatively to
rackControl.detectLossand its children. A temporaryTCPRecovery=0control raises native download from 237 to 448 Mbit/s (one stream), and from 344 to 466 (eight). This establishes a contributor, not the entire remaining gap. Disabling loss recovery is not a proposed production fix; packet loss/reordering behavior was not tested. System calls and packet processing remain important; telemetry/GC do not appear as primary CPU consumers in this experiment.All 18 profiling/control workloads pass. CPU, block, mutex, alloc/heap, mid-run goroutine profiles and separate execution traces are retained outside Git with source/binary hashes. No production code was changed for profiling.
Validation: Fastlane Python checks pass (93 tests); CI for the exact head is successful, including native integration and Android API 26/35. VM setup smoke passes 30/30. Old iperf3 3.16 is rejected before setup; an intentionally SIGKILLed private iperf server verifies explicit signal reporting and preservation of one partial measurement with
complete: false.Short samples, shared server/load CPU, VM scheduling and prerelease sing-box limit generalization. These are Linux TUN measurements; Android/JNI and energy performance are not measured.
APK artifacts
Built from commit
18973b3cby CI run #494.Artifacts expire after 14 days. Neither APK uses the MegaProxy release key.