c# - What's the purpose of the 'short' notation of IL? -
every time bumb them in il: br_s, ldc_i4_s, ldarg_s, etc, etc... have ask question:
i mean... if you're jit'ing language il native assembler, shouldn't matter in terms of performance, right? what's purpose of having these 'short-hand' notations? having fewer bytes in il binaries (e.g. compression mechanism) or there other reason?
and if it's compression mechanism, why not use compression algorithm deflate?
sure, micro-optimization. golden rule of micro-optimizing applies here, turn macro when can apply optimization on , on again. case here, method bodies small vast majority of branches short ones, methods have limited number of arguments , local variables single byte enough address them, constants 0 through 9 appear in real program.
add them , have macro-optimization on large assembly, many kilobytes shaved-off. does matter @ runtime, that's il doesn't have page-faulted ram. warm-start time in jitted program issue , has been attacked every possible angle.
in general, .net framework relentlessly micro-optimized. largely because microsoft can't assume code won't on critical path in program.
Comments
Post a Comment