@@ -112,6 +112,7 @@ module {:options "-functionSyntax:4"} DdbEncryptionTestVectors {
112
112
Validate ();
113
113
StringOrdering ();
114
114
LargeTests ();
115
+ PerfQueryTests ();
115
116
BasicIoTest ();
116
117
RunIoTests ();
117
118
BasicQueryTest ();
@@ -539,6 +540,35 @@ module {:options "-functionSyntax:4"} DdbEncryptionTestVectors {
539
540
}
540
541
}
541
542
543
+ method PerfQueryTests ()
544
+ {
545
+ print "\n";
546
+ RunQueryTest ("one", map["x" := SE.DO_NOTHING], None, Some(""), None);
547
+ RunQueryTest ("two", map["x" := SE.DO_NOTHING], None, Some("this is a fairly long query string but I dont see why it should cause a problem."), None);
548
+ RunQueryTest ("three", map["x" := SE.DO_NOTHING], None,
549
+ Some("begins_with (#param_0, :param_0_v0 ) AND begins_with (#param_1, :param_1_v0 )"),
550
+ Some (map["#param_0" := "rangeKey", "#param_1" := "hashKey"]));
551
+ }
552
+
553
+ method RunQueryTest (
554
+ name : string ,
555
+ actions : Types .AttributeActions,
556
+ keyExpr : Option <DDB .KeyExpression>,
557
+ filterExpr : Option <DDB .ConditionExpression>,
558
+ names : Option <DDB .ExpressionAttributeNameMap>
559
+ )
560
+ {
561
+ var time := Time. GetAbsoluteTime ();
562
+ for i : uint32 := 0 to 10000 {
563
+ var x := Filter. TestBeaconize (actions, keyExpr, filterExpr, names);
564
+ if x. Failure? {
565
+ print "\nRunQueryTest ", name, " Failed : ", x. error, "\n\n";
566
+ return ;
567
+ }
568
+ }
569
+ Time. PrintTimeSinceLong (time, "TestBeaconize " + name, DecryptManifest.LogFileName());
570
+ }
571
+
542
572
method RunLargeTest (record : LargeRecord , client : Trans .IDynamoDbEncryptionTransformsClient, config : string )
543
573
requires client. ValidState ()
544
574
ensures client. ValidState ()
0 commit comments