chainwayxyz / citrea

Citrea, Bitcoin's First ZK Rollup 🍊🍋
https://citrea.xyz
GNU General Public License v3.0
129 stars 26 forks source link

Consider replacing bcs with borsh #1008

Open kpp opened 3 months ago

kpp commented 3 months ago

All values in our storage go through bcs -> serde.

                                            106600 52.80% |   sov_modules_core::storage::StorageKey::new unknown
                                             49920 24.73% |   citrea_evm::evm::db_commit::<impl revm_primitives::db::DatabaseCommit for citrea_evm::evm::db::EvmDb<C>>::commit unknown
                                             24168 11.97% |   citrea_evm::evm::primitive_types::_::<impl serde::ser::Serialize for citrea_evm::evm::primitive_types::TransactionSignedAndRecovered>::serialize unknown
                                             12480  6.18% |   sov_modules_api::containers::traits::map::StateMapAccessor::set unknown
                                              8730  4.32% |   sov_modules_core::storage::StorageValue::new unknown
     58442  0.12% 96.32%     201898   0.4%                | ruint::support::serde::<impl serde::ser::Serialize for ruint::Uint<_,_>>::serialize unknown
                                             73761 36.53% |   alloc::raw_vec::RawVec<T,A>::reserve::do_reserve_and_handle unknown
                                             69695 34.52% |   memcpy unknown
eyusufatik commented 3 months ago

we can make a benchmark for this. both are non-descriptive so there shouldn't be much of a difference usage wise