gear-tech / gear

Web3 Ultimate Execution Engine
https://gear-tech.io
GNU General Public License v3.0
237 stars 105 forks source link

investigate how lazy pages common works with memory allocations #2441

Open grishasobol opened 1 year ago

grishasobol commented 1 year ago

Problem to Solve

@ukint-vs saw that in some cases .ok_or(Error::) cause additional allocations, so we need to investigate this cases and solve them. See lazy-pages/src/common.rs

Possible Solution

-

Notes

No response

NikVolf commented 1 year ago

ok_or(<any type with allocations>) should probably be refactored to ok_or_else(|| <any type with allocations>)

ukint-vs commented 1 year ago

ok_or(<any type with allocations>) should probably be refactored to ok_or_else(|| <any type with allocations>)

@grishasobol believes that these allocations do not affect anything but what's the point of having them at all if errors should be rare?