Skip to content

Commit

Permalink
use enum_dispatch (#615)
Browse files Browse the repository at this point in the history
### Description

we were initially considering using `dyn trait` to address the concerns around having too many match statements. however, since dyn trait has a performance concern, we decided to go with `enum_dispatch`, which is 10x performant 

### Test Plan

![Screenshot 2024-11-22 at 11.59.24 AM.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/XVbPtMdqqe4K1PNnLQvf/8d2f07cb-3d20-49fb-af53-22e0245273b2.png)
  • Loading branch information
yuunlimm authored Nov 26, 2024
1 parent 3d22e3b commit 8f2df33
Show file tree
Hide file tree
Showing 8 changed files with 113 additions and 170 deletions.
51 changes: 1 addition & 50 deletions rust/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions rust/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -146,3 +146,4 @@ serde_canonical_json = "1.0.0"
allocative = "0.3.3"
allocative_derive = "0.3.3"
mockall = "0.12.1"
downcast-rs = "1.2.1"
13 changes: 0 additions & 13 deletions rust/integration-tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,27 +22,14 @@ aptos-protos = { workspace = true }
assert-json-diff = { workspace = true }
bigdecimal = { workspace = true }
chrono = { workspace = true }
clap = { workspace = true }
diesel = { workspace = true }
dirs = { workspace = true }
field_count = { workspace = true }
futures = { workspace = true }
itertools = { workspace = true }
json-structural-diff = { workspace = true }
once_cell = { workspace = true }
processor = { workspace = true }
prost = { workspace = true }
regex = { workspace = true }
sdk-processor = { workspace = true }
serde = { workspace = true }
serde_canonical_json = { workspace = true }
serde_json = { workspace = true }
tempfile = { workspace = true }
testcontainers = { workspace = true }
testing-transactions = { workspace = true }
tokio = { workspace = true }
tonic = { workspace = true }
url = { workspace = true }

[dev-dependencies]
ahash = { workspace = true }
Expand Down
2 changes: 0 additions & 2 deletions rust/processor/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ ahash = { workspace = true }
allocative = { workspace = true }
allocative_derive = { workspace = true }
anyhow = { workspace = true }
aptos-indexer-processor-sdk = { workspace = true }
aptos-moving-average = { workspace = true }
aptos-protos = { workspace = true }
async-trait = { workspace = true }
Expand Down Expand Up @@ -63,7 +62,6 @@ url = { workspace = true }

# Postgres SSL support
native-tls = { workspace = true }
num = { workspace = true }
postgres-native-tls = { workspace = true }
tiny-keccak = { workspace = true }
tokio-postgres = { workspace = true }
Expand Down
10 changes: 1 addition & 9 deletions rust/sdk-processor/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,39 +12,31 @@ aptos-indexer-processor-sdk = { workspace = true }
aptos-indexer-processor-sdk-server-framework = { workspace = true }
aptos-indexer-testing-framework = { workspace = true }
async-trait = { workspace = true }
bcs = { workspace = true }
bigdecimal = { workspace = true }
chrono = { workspace = true }
clap = { workspace = true }
diesel = { workspace = true }
diesel-async = { workspace = true }
diesel_migrations = { workspace = true }
enum_dispatch = { workspace = true }
field_count = { workspace = true }
futures = { workspace = true }
futures-util = { workspace = true }

google-cloud-storage = { workspace = true }
hex = { workspace = true }
jemallocator = { workspace = true }
kanal = { workspace = true }
lazy_static = { workspace = true }

mockall = { workspace = true }

# Postgres SSL support
native-tls = { workspace = true }
num_cpus = { workspace = true }
# Parquet support
parquet = { workspace = true }
parquet_derive = { workspace = true }
postgres-native-tls = { workspace = true }
processor = { workspace = true }
rayon = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }
sha2 = { workspace = true }
strum = { workspace = true }
tiny-keccak = { workspace = true }
tokio = { workspace = true }
tokio-postgres = { workspace = true }
tracing = { workspace = true }
Expand Down
Loading

0 comments on commit 8f2df33

Please sign in to comment.