Skip to content

Commit 25b32e9

Browse files
committed
Added benchmark repo for testing goroutines and other optimizations
Signed-off-by: Felix Wang <[email protected]>
1 parent a98534b commit 25b32e9

File tree

6 files changed

+1778
-0
lines changed

6 files changed

+1778
-0
lines changed

go/benchmark_repo/benchmark.py

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import numpy as np
2+
3+
import time
4+
from feast.feature_store import FeatureStore
5+
6+
num_features = 50
7+
entity_keyspace = 10**4
8+
entity_rows = 1
9+
10+
fs = FeatureStore(repo_path=".")
11+
features = [
12+
f"feature_view_{i // 10}:feature_{i}"
13+
for i in range(num_features)
14+
]
15+
join_keys = np.random.randint(0, entity_keyspace, entity_rows).tolist()
16+
entity_rows= [
17+
{"entity": join_key}
18+
for join_key in join_keys
19+
]
20+
21+
# Force Go server to startup.
22+
results = fs.get_online_features(
23+
features=features,
24+
entity_rows=entity_rows,
25+
)
26+
27+
start_time = time.time()
28+
results = fs.get_online_features(
29+
features=features,
30+
entity_rows=entity_rows,
31+
)
32+
end_time = time.time()
33+
print(f"total time: {end_time - start_time} seconds")
10.2 MB
Binary file not shown.

0 commit comments

Comments
 (0)