tikv/tikv

Add Box<> to some types to eliminate move cost

Aperta

#4042 aperta il 9 gen 2019

 (4 commenti) (1 reazione) (0 assegnatari)Rust (2189 fork)batch import
component/performancehelp wantedstatus/mentor

Metriche repository

Star
 (15.922 stelle)
Metriche merge PR
 (Merge medio 28g 9h) (68 PR mergiate in 30 g)

Descrizione

Feature Request

Some types' size is large, e.g. mysql::Time has a size of about 50 bytes. When variables in these types are moved, it costs a lot. Additionally, Datum is an enum including a mysql::Time so that Datum becomes this large as well!

By wrapping such type in a Box we may eliminate some moving cost.

Notice that we should only do this in performance critical path.

Guida contributor