You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 16, 2021. It is now read-only.
#![recursion_limit = "1024"]#[macro_use]externcrate error_chain;mod errors {error_chain!{}}fnmain(){use errors::ResultasChainResult;use std::mem::size_of;println!("size of vanilla result {}", size_of::<Result<(),()>>());println!("size of error_chain result {}", size_of::<ChainResult<()>>());}
outputs:
size of vanilla result 1
size of error_chain result 56
I might be wrong, but isn't ChainResult just "yet another enum", which means those 55 extra bytes have to be copied over when returning, even in the success event? That would mean quite a performance overhead over normal Result in hot code, especially where only the Ok case which may be minimal is encountered, no?
Maybe the situation can be improved by making the backtrace functionality optional, as in possible to opt out of at compile time?