System.ComponentModel
A library or CoreLib type served from the framework’s IL: its row of the per-library table of ADR 0023 (columns explained there, under “Measurements”).
| Library (switch) | Correctness (samples from IL) | Binary size, IL / shadow | Compile cpu, IL / shadow | Speed, IL / shadow (time) | Lines removed on a flip | Decision | NativeAOT on the same host, csharpc / NativeAOT (tools/il-first/measure-aot.sh: stripped size; compile cpu; run, median of 7; instructions) |
|---|---|---|---|---|---|---|---|
System.ComponentModel, .Primitives, .TypeConverter (System.ComponentModel.TypeConverter,System.ComponentModel,System.ComponentModel.Primitives) |
13 of 13 samples that use them pass from IL after the fixes below (the first A/B: 8 of 13; blockers listed in #276), byte-identical to real .NET; the A/B sums over the 11 both routes passed at that point; after the flip 50 runs at -O0 and -O2 (TypeConverter, TypeDescriptor, property descriptors, Drawing converters, DefaultValue, JSON converters, TLS/X509 collections) and the four preserialized-resource / configuration project tests. Security: the shadow’s guards are upstream’s (the shadow was a port of the converter classes with their argument and culture checks); the new run-time members check their arguments with .NET’s exceptions and messages (sample 1312), and COM stays absent: Marshal.IsComObject and ComWrappers.TryGetComInstance answer as on a platform with no COM objects, Marshal.Release is an explicit PlatformNotSupportedException |
2.62x over those 11 samples (14 224 against 5 423 KB: 642 679 to 3 700 KB, 643 514 to 3 546 KB, 671 1 518 to 4 253 KB; programs that do not call TypeDescriptor are unchanged), and tests/size regex +30 KB (the string tables of the added assemblies, #272) |
2.30x (260 against 113 CPU s) | 0.64x over the samples (249 against 388 ms); the throughput program’s checksum equals real .NET | 2 244 (corelib/ComponentModel/*) + 68 (the event-args shadows in EventArgs.cs) + 116 deleted and 32 added in the converter hooks (TypeConverterFor, TypeConverterHook, the typeof and ldtoken scans) |
Flipped (#276). Gaps closed in the compiler / runtime, none specific to a library: Type.Attributes (csrt_type_attributes: visibility, interface, abstract, sealed, sequential layout); Enum.Format(Type, object, string) and Enum.GetValuesAsUnderlyingType(Type) for run-time Types; ArrayList.Adapter; the [Serializable] pseudo-attribute and the attribute classes framework types carry (TypeForwardedFrom, DebuggerDisplay, DebuggerTypeProxy, Flags, AttributeUsage, CLSCompliant, ComVisible); Attribute.GetCustomAttributes/GetCustomAttribute/IsDefined(MemberInfo, ...) from the framework’s IL answer with the attributes csharpc models, as the instance queries do; a [TypeConverter(string)] type is kept for creation as the Type overload keeps it; COM’s negative answers; the string-comparer family of OrderedDictionary. The framework-IL choice always takes System.ComponentModel.TypeConverter (ResourceManager and DefaultValueAttribute convert with TypeDescriptor), with the closure limits it already had. |
componentmodel_throughput: 2 800 312 / 3 378 736 B; compile cpu 70.3 / 25.3 s; run 352 / 198 ms (1.77x); 1.59 G / 1.04 G instructions |