Commit 0f5fc75
perf: optimize protobuf parsing in Redis online store
- Avoid redundant bytes() conversion when data is already bytes type
- Use list comprehension for more efficient batch conversion
- Add return type annotation for _convert_redis_values_to_protobuf
- Remove unnecessary else clause for cleaner control flow
This reduces overhead in the hot path for feature retrieval,
especially when fetching many features across many entities.
Estimated savings: 2-5ms per request for typical workloads.
Co-authored-by: Cursor <cursoragent@cursor.com>1 parent 7ab7642 commit 0f5fc75
1 file changed
+18
-17
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
372 | 372 | | |
373 | 373 | | |
374 | 374 | | |
375 | | - | |
376 | | - | |
377 | | - | |
378 | | - | |
379 | | - | |
380 | | - | |
381 | | - | |
382 | | - | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
383 | 380 | | |
384 | 381 | | |
385 | 382 | | |
| |||
445 | 442 | | |
446 | 443 | | |
447 | 444 | | |
448 | | - | |
| 445 | + | |
| 446 | + | |
449 | 447 | | |
450 | | - | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
451 | 451 | | |
452 | | - | |
| 452 | + | |
453 | 453 | | |
454 | 454 | | |
455 | 455 | | |
456 | | - | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
457 | 459 | | |
458 | 460 | | |
459 | 461 | | |
460 | 462 | | |
461 | | - | |
462 | | - | |
463 | | - | |
464 | | - | |
465 | | - | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
0 commit comments