Stream: t-compiler

Topic: remove layout calculation from assert_bits


Björn Steinbrink (Jan 10 2019 at 22:19, on Zulip):

assert_bits already asserts that the value type equals the type that is being passed into the function, so it seems sensible to me to skip the size calculation, which is ultimately only used to assert that the size of the passed-in type is equal to the size stored in the const itself. My main motivation for this is that match checking calls assert_bits a ton of times for large matches ( > 20M for unicode_normalization) leading to millions of IMHO unneeded queries. Changing that cuts about 60-70% of the time from match checking for the unicode_normalization crate. Opinions?

nagisa (Jan 10 2019 at 22:36, on Zulip):

if removing code that supports assertions gives tremendous speed ups then by all means do that

nagisa (Jan 10 2019 at 22:36, on Zulip):

perhaps make it a cheaper assertion?

nagisa (Jan 10 2019 at 22:38, on Zulip):

final alternative is to make it a debug_assertion

Last update: Nov 16 2019 at 01:55UTC