refactor(core): Eliminate XxxProvider enums#830
Merged
Conversation
Replace 13 XxxProvider enums (with Service/Mock variants and delegation impls) with Box<dyn XxxApi> trait objects in Provider. Consolidate 13 mock.rs files into single mocks.rs with all mock! definitions. This removes ~3300 lines of repetitive enum, delegation, and per-module mock boilerplate. Provider fields are now Box<dyn XxxApi>, builder accepts impl XxxApi for mock injection, and getters return trait refs. This also slightly improves the compilation time (roughly 60%) Signed-off-by: Artem Goncharov <artem.goncharov@gmail.com>
|
🦢 Load Test Results Goose Attack ReportPlan Overview
Request Metrics
Response Time Metrics
Status Code Metrics
Transaction Metrics
Scenario Metrics
|
|
| Branch | eliminate-prov-enums |
| Testbed | ubuntu-latest |
Click to view all benchmark results
| Benchmark | Latency | Benchmark Result nanoseconds (ns) (Result Δ%) | Upper Boundary nanoseconds (ns) (Limit %) |
|---|---|---|---|
| Command_Serde/apply/remove | 📈 view plot 🚷 view threshold | 130,500.00 ns(-9.70%)Baseline: 144,521.31 ns | 460,662.50 ns (28.33%) |
| Command_Serde/apply/set | 📈 view plot 🚷 view threshold | 147,520.00 ns(+11.83%)Baseline: 131,916.55 ns | 290,548.75 ns (50.77%) |
| Command_Serde/pack/delete | 📈 view plot 🚷 view threshold | 119.64 ns(-1.06%)Baseline: 120.92 ns | 142.71 ns (83.83%) |
| Command_Serde/pack/delete_index | 📈 view plot 🚷 view threshold | 108.91 ns(-3.10%)Baseline: 112.39 ns | 133.51 ns (81.57%) |
| Command_Serde/pack/set | 📈 view plot 🚷 view threshold | 201.79 ns(+3.09%)Baseline: 195.74 ns | 235.62 ns (85.64%) |
| Command_Serde/pack/set_index | 📈 view plot 🚷 view threshold | 109.11 ns(-3.02%)Baseline: 112.51 ns | 133.25 ns (81.89%) |
| Command_Serde/unpack/delete | 📈 view plot 🚷 view threshold | 193.20 ns(+1.20%)Baseline: 190.91 ns | 236.09 ns (81.83%) |
| Command_Serde/unpack/delete_index | 📈 view plot 🚷 view threshold | 155.72 ns(-5.86%)Baseline: 165.42 ns | 204.88 ns (76.01%) |
| Command_Serde/unpack/set | 📈 view plot 🚷 view threshold | 248.17 ns(+0.45%)Baseline: 247.06 ns | 291.97 ns (85.00%) |
| Command_Serde/unpack/set_index | 📈 view plot 🚷 view threshold | 160.33 ns(-2.04%)Baseline: 163.66 ns | 201.87 ns (79.42%) |
| Payload_encryption/pack/inner | 📈 view plot 🚷 view threshold | 65.05 ns(+4.07%)Baseline: 62.51 ns | 76.52 ns (85.02%) |
| Payload_encryption/pack/remove_cmd | 📈 view plot 🚷 view threshold | 122.34 ns(+1.69%)Baseline: 120.31 ns | 151.42 ns (80.79%) |
| Payload_encryption/pack/set_cmd | 📈 view plot 🚷 view threshold | 196.89 ns(-11.52%)Baseline: 222.52 ns | 282.73 ns (69.64%) |
| Payload_encryption/unpack/inner | 📈 view plot 🚷 view threshold | 168.92 ns(+2.29%)Baseline: 165.13 ns | 193.78 ns (87.17%) |
| Payload_encryption/unpack/remove_cmd | 📈 view plot 🚷 view threshold | 214.32 ns(+6.94%)Baseline: 200.42 ns | 248.58 ns (86.22%) |
| Payload_encryption/unpack/set_cmd | 📈 view plot 🚷 view threshold | 280.31 ns(+8.77%)Baseline: 257.72 ns | 308.04 ns (91.00%) |
| Raft_1Node_Latency/prefix/1node | 📈 view plot 🚷 view threshold | 2,400,500.00 ns(-35.18%)Baseline: 3,703,493.28 ns | 6,918,962.94 ns (34.69%) |
| Raft_1Node_Latency/read/1node | 📈 view plot 🚷 view threshold | 588.54 ns(+2.30%)Baseline: 575.28 ns | 671.44 ns (87.65%) |
| Raft_1Node_Latency/remove/1node | 📈 view plot 🚷 view threshold | 391,210.00 ns(+2.97%)Baseline: 379,929.22 ns | 976,128.36 ns (40.08%) |
| Raft_1Node_Latency/write/1node | 📈 view plot 🚷 view threshold | 401,480.00 ns(+9.06%)Baseline: 368,132.81 ns | 780,104.83 ns (51.46%) |
| build_snapshot/default | 📈 view plot 🚷 view threshold | 86,249.00 ns(-7.12%)Baseline: 92,858.03 ns | 153,114.67 ns (56.33%) |
| fernet token/project | 📈 view plot 🚷 view threshold | 1,430.60 ns(+1.07%)Baseline: 1,415.44 ns | 1,617.04 ns (88.47%) |
| get_data_keyspace | 📈 view plot 🚷 view threshold | 0.33 ns(+1.97%)Baseline: 0.32 ns | 0.38 ns (86.15%) |
| get_db | 📈 view plot 🚷 view threshold | 0.33 ns(+1.85%)Baseline: 0.32 ns | 0.38 ns (86.01%) |
| get_fernet_token_timestamp/project | 📈 view plot 🚷 view threshold | 144.72 ns(-0.13%)Baseline: 144.91 ns | 170.04 ns (85.11%) |
| get_keyspace | 📈 view plot 🚷 view threshold | 4.36 ns(-11.42%)Baseline: 4.92 ns | 9.48 ns (45.95%) |
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.
Replace 13 XxxProvider enums (with Service/Mock variants and delegation
impls) with Box trait objects in Provider. Consolidate
13 mock.rs files into single mocks.rs with all mock! definitions.
This removes ~3300 lines of repetitive enum, delegation, and per-module
mock boilerplate. Provider fields are now Box, builder
accepts impl XxxApi for mock injection, and getters return trait refs.
This also slightly improves the compilation time (roughly 60%)
Signed-off-by: Artem Goncharov artem.goncharov@gmail.com