@@ -3717,3 +3717,22 @@ fn update_opacity_binding(
3717
3717
binding. current
3718
3718
}
3719
3719
}
3720
+
3721
+ #[ test]
3722
+ #[ cfg( target_os = "linux" ) ]
3723
+ fn test_struct_sizes ( ) {
3724
+ // The sizes of these structures are critical for performance on a number of
3725
+ // talos stress tests. If you get a failure here on CI, there's two possibilities:
3726
+ // (a) You made a structure smaller than it currently is. Great work! Update the
3727
+ // test expectations and move on.
3728
+ // (b) You made a structure larger. This is not necessarily a problem, but should only
3729
+ // be done with care, and after checking if talos performance regresses badly.
3730
+ assert_eq ! ( mem:: size_of:: <PrimitiveContainer >( ) , 256 , "PrimitiveContainer size changed" ) ;
3731
+ assert_eq ! ( mem:: size_of:: <PrimitiveInstance >( ) , 120 , "PrimitiveInstance size changed" ) ;
3732
+ assert_eq ! ( mem:: size_of:: <PrimitiveInstanceKind >( ) , 16 , "PrimitiveInstanceKind size changed" ) ;
3733
+ assert_eq ! ( mem:: size_of:: <PrimitiveTemplate >( ) , 176 , "PrimitiveTemplate size changed" ) ;
3734
+ assert_eq ! ( mem:: size_of:: <PrimitiveTemplateKind >( ) , 112 , "PrimitiveTemplateKind size changed" ) ;
3735
+ assert_eq ! ( mem:: size_of:: <PrimitiveKey >( ) , 152 , "PrimitiveKey size changed" ) ;
3736
+ assert_eq ! ( mem:: size_of:: <PrimitiveKeyKind >( ) , 112 , "PrimitiveKeyKind size changed" ) ;
3737
+ assert_eq ! ( mem:: size_of:: <Primitive >( ) , 280 , "Primitive size changed" ) ;
3738
+ }
0 commit comments