@@ -117,6 +117,39 @@ func BenchmarkClientSerialTyped(b *testing.B) {
117
117
}
118
118
}
119
119
120
+ func BenchmarkClientSerialSQL (b * testing.B ) {
121
+ // Tarantool supports SQL since version 2.0.0
122
+ isLess , err := test_helpers .IsTarantoolVersionLess (2 , 0 , 0 )
123
+ if err != nil {
124
+ b .Fatal ("Could not check the Tarantool version" )
125
+ }
126
+ if isLess {
127
+ b .Skip ()
128
+ }
129
+
130
+ conn , err := Connect (server , opts )
131
+ if err != nil {
132
+ b .Errorf ("Failed to connect: %s" , err )
133
+ return
134
+ }
135
+ defer conn .Close ()
136
+
137
+ spaceNo := 519
138
+ _ , err = conn .Replace (spaceNo , []interface {}{uint (1111 ), "hello" , "world" })
139
+ if err != nil {
140
+ b .Errorf ("Failed to replace: %s" , err )
141
+ }
142
+
143
+ b .ResetTimer ()
144
+ for i := 0 ; i < b .N ; i ++ {
145
+ _ , err := conn .Execute ("SELECT NAME0,NAME1,NAME2 FROM SQL_TEST WHERE NAME0=?" , []interface {}{uint (1111 )})
146
+ if err != nil {
147
+ b .Errorf ("Select failed: %s" , err .Error ())
148
+ break
149
+ }
150
+ }
151
+ }
152
+
120
153
func BenchmarkClientFuture (b * testing.B ) {
121
154
var err error
122
155
@@ -364,7 +397,7 @@ func BenchmarkClientParallelMassiveUntyped(b *testing.B) {
364
397
close (limit )
365
398
}
366
399
367
- func BenchmarkClientReplaceParallel (b * testing.B ) {
400
+ func BenchmarkClientParallelReplace (b * testing.B ) {
368
401
conn , err := Connect (server , opts )
369
402
if err != nil {
370
403
b .Errorf ("No connection available" )
@@ -389,7 +422,7 @@ func BenchmarkClientReplaceParallel(b *testing.B) {
389
422
})
390
423
}
391
424
392
- func BenchmarkClientLargeSelectParallel (b * testing.B ) {
425
+ func BenchmarkClientParallelLargeSelect (b * testing.B ) {
393
426
conn , err := Connect (server , opts )
394
427
if err != nil {
395
428
b .Errorf ("No connection available" )
@@ -415,7 +448,7 @@ func BenchmarkClientLargeSelectParallel(b *testing.B) {
415
448
})
416
449
}
417
450
418
- func BenchmarkSQLParallel (b * testing.B ) {
451
+ func BenchmarkClientParallelSQL (b * testing.B ) {
419
452
// Tarantool supports SQL since version 2.0.0
420
453
isLess , err := test_helpers .IsTarantoolVersionLess (2 , 0 , 0 )
421
454
if err != nil {
@@ -450,39 +483,6 @@ func BenchmarkSQLParallel(b *testing.B) {
450
483
})
451
484
}
452
485
453
- func BenchmarkSQLSerial (b * testing.B ) {
454
- // Tarantool supports SQL since version 2.0.0
455
- isLess , err := test_helpers .IsTarantoolVersionLess (2 , 0 , 0 )
456
- if err != nil {
457
- b .Fatal ("Could not check the Tarantool version" )
458
- }
459
- if isLess {
460
- b .Skip ()
461
- }
462
-
463
- conn , err := Connect (server , opts )
464
- if err != nil {
465
- b .Errorf ("Failed to connect: %s" , err )
466
- return
467
- }
468
- defer conn .Close ()
469
-
470
- spaceNo := 519
471
- _ , err = conn .Replace (spaceNo , []interface {}{uint (1111 ), "hello" , "world" })
472
- if err != nil {
473
- b .Errorf ("Failed to replace: %s" , err )
474
- }
475
-
476
- b .ResetTimer ()
477
- for i := 0 ; i < b .N ; i ++ {
478
- _ , err := conn .Execute ("SELECT NAME0,NAME1,NAME2 FROM SQL_TEST WHERE NAME0=?" , []interface {}{uint (1111 )})
479
- if err != nil {
480
- b .Errorf ("Select failed: %s" , err .Error ())
481
- break
482
- }
483
- }
484
- }
485
-
486
486
///////////////////
487
487
488
488
func TestClient (t * testing.T ) {
0 commit comments