@@ -5,7 +5,7 @@ using Random
55
66SUITE = BenchmarkGroup ()
77
8- @syms a b c d; Random. seed! (123 );
8+ @syms a b c d x y[ 1 : 3 ] z[ 1 : 2 , 1 : 2 ] ; Random. seed! (123 );
99
1010let r = @rule (~ x => ~ x), rs = RuleSet ([r]),
1111 acr = @rule (~ x:: is_literal_number + ~ y => ~ y)
@@ -67,7 +67,19 @@ let r = @rule(~x => ~x), rs = RuleSet([r]),
6767 subs_expr = (sin (a+ b) + cos (b+ c)) * (sin (b+ c) + cos (c+ a)) * (sin (c+ a) + cos (a+ b))
6868 end
6969
70+ overhead[" get_degrees" ] = BenchmarkGroup ()
7071
72+ let y1 = term (getindex, y, 1 , type= Number),
73+ y2 = term (getindex, y, 2 , type= Number),
74+ y3 = term (getindex, y, 3 , type= Number),
75+ z11 = term (getindex, z, 1 , 1 , type= Number),
76+ z12 = term (getindex, z, 1 , 2 , type= Number),
77+ z23 = term (getindex, z, 2 , 3 , type= Number),
78+ # create a relatively large polynomial
79+ large_poly = SymbolicUtils. expand ((x^ 2 + 2 y1 + 3 z12 + y2* z23 + x* y1* z12 - x^ 2 * z12 + x* z11 + y3 + y2 + z23 + 1 )^ 8 )
80+
81+ overhead[" get_degrees" ][" large_poly" ] = @benchmarkable SymbolicUtils. get_degrees ($ large_poly)
82+ end
7183end
7284
7385let
0 commit comments