From eae961ee9908e85dd4d02e204d4d348551f4cf1b Mon Sep 17 00:00:00 2001 From: Sergei Shulepov Date: Wed, 13 Jan 2021 10:12:29 +0100 Subject: [PATCH] Avoid inlining `update_config_member` (#2246) Closes #2241 --- polkadot/runtime/parachains/src/configuration.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/polkadot/runtime/parachains/src/configuration.rs b/polkadot/runtime/parachains/src/configuration.rs index 847a16b11c..4691c0059d 100644 --- a/polkadot/runtime/parachains/src/configuration.rs +++ b/polkadot/runtime/parachains/src/configuration.rs @@ -652,6 +652,11 @@ impl Module { } } + // NOTE: Explicitly tell rustc not to inline this because otherwise heuristics note the incoming + // closure making it's attractive to inline. However, in this case, we will end up with lots of + // duplicated code (making this function to show up in the top of heaviest functions) only for + // the sake of essentially avoiding an indirect call. Doesn't worth it. + #[inline(never)] fn update_config_member( updater: impl FnOnce(&mut HostConfiguration) -> bool, ) {