Conversation
|
✅ All CI checks and tests passed. Datadog automation helped this PR pass. 🎉 All green!🧪 All tests passed 🔄 Datadog retried 1 test - 1 passed on retry 🎯 Code Coverage (details) 🔗 Commit SHA: 9a463ce | Docs | View more details | Give us feedback! |
4 tasks
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.
What does this PR do?
Adds a standalone, benchmark-only Kotlin rules evaluator under
prototypes/rules-evaluation. This provides the Android counterpart to the Swift prototype so we can compare parsing and evaluation in JavaScript versus native code from React Native.@datadog/flagging-core@3.1.1, plus targeted correctness and error-handling tests.This is not a production provider or a complete UFC evaluator. It adds no shipping SDK API and is not included in the Android SDK's module graph. The RN adapter owns bridge serialization, scheduling, and platform reporting; this module owns parsing, evaluation, and benchmark operations.
Motivation
FFL-3347: provide Android evidence for the mobile SDK building blocks and benchmarks RFC.
We want to separate the cost of decoding, evaluation, RN transport, and loading cached configuration before choosing where each responsibility belongs. This prototype supports six decode/evaluation placements and three cached-loading paths through the RN harness.
Companion work:
The Android adapter, runner, native-tracking and batching experiments, and detailed results are published in RN commit c7b19737. Kotlin unit tests can run independently of that harness.
Additional Notes
Validation
git diff --checkpasses. The full shipping Android SDK build/lint suite was not run; its root tasks do not exercise this standalone project.To run the focused tests with JDK 17 and Gradle 8.10.2:
gradle -p prototypes/rules-evaluation --no-daemon --max-workers=2 testThe RN Gradle 8.12 wrapper can also run the standalone project with
-p. This experiment does not use the Android repository's root Gradle 9 wrapper. See the prototype README for dependencies, fixture provenance, and companion setup.Initial Findings
For the 100-flag configuration, repeated-read p50 was 5.96-6.00 us for JS decoding/evaluation, 14.21-14.62 us for native decoding/evaluation over the synchronous bridge, and 188.04-199.63 us over the asynchronous bridge. Ranges summarize two runs, each using the median of five per-repetition percentiles; they are not confidence intervals.
The native-direct evaluator control was faster (0.750-0.875 us p50), but excludes RN transport and uses preconverted inputs. These findings support keeping repeated RN reads in JS, not a claim that the JS evaluator itself is faster. Native-only cached loading reached the first result sooner; native decoding followed by a ProtoJSON transfer to JS was slower than transferring bytes and decoding in JS.
Limits
Review checklist (to be filled by reviewers)