@@ -149,6 +149,39 @@ func BenchmarkClientSerialTyped(b *testing.B) {
149
149
}
150
150
}
151
151
152
+ func BenchmarkClientSerialSQL (b * testing.B ) {
153
+ // Tarantool supports SQL since version 2.0.0
154
+ isLess , err := test_helpers .IsTarantoolVersionLess (2 , 0 , 0 )
155
+ if err != nil {
156
+ b .Fatal ("Could not check the Tarantool version" )
157
+ }
158
+ if isLess {
159
+ b .Skip ()
160
+ }
161
+
162
+ conn , err := Connect (server , opts )
163
+ if err != nil {
164
+ b .Errorf ("Failed to connect: %s" , err )
165
+ return
166
+ }
167
+ defer conn .Close ()
168
+
169
+ spaceNo := 519
170
+ _ , err = conn .Replace (spaceNo , []interface {}{uint (1111 ), "hello" , "world" })
171
+ if err != nil {
172
+ b .Errorf ("Failed to replace: %s" , err )
173
+ }
174
+
175
+ b .ResetTimer ()
176
+ for i := 0 ; i < b .N ; i ++ {
177
+ _ , err := conn .Execute ("SELECT NAME0,NAME1,NAME2 FROM SQL_TEST WHERE NAME0=?" , []interface {}{uint (1111 )})
178
+ if err != nil {
179
+ b .Errorf ("Select failed: %s" , err .Error ())
180
+ break
181
+ }
182
+ }
183
+ }
184
+
152
185
func BenchmarkClientFuture (b * testing.B ) {
153
186
var err error
154
187
@@ -368,7 +401,7 @@ func BenchmarkClientParallelMassiveUntyped(b *testing.B) {
368
401
close (limit )
369
402
}
370
403
371
- func BenchmarkClientReplaceParallel (b * testing.B ) {
404
+ func BenchmarkClientParallelReplace (b * testing.B ) {
372
405
conn , err := Connect (server , opts )
373
406
if err != nil {
374
407
b .Errorf ("No connection available" )
@@ -393,7 +426,7 @@ func BenchmarkClientReplaceParallel(b *testing.B) {
393
426
})
394
427
}
395
428
396
- func BenchmarkClientLargeSelectParallel (b * testing.B ) {
429
+ func BenchmarkClientParallelLargeSelect (b * testing.B ) {
397
430
conn , err := Connect (server , opts )
398
431
if err != nil {
399
432
b .Errorf ("No connection available" )
@@ -419,7 +452,7 @@ func BenchmarkClientLargeSelectParallel(b *testing.B) {
419
452
})
420
453
}
421
454
422
- func BenchmarkSQLParallel (b * testing.B ) {
455
+ func BenchmarkClientParallelSQL (b * testing.B ) {
423
456
// Tarantool supports SQL since version 2.0.0
424
457
isLess , err := test_helpers .IsTarantoolVersionLess (2 , 0 , 0 )
425
458
if err != nil {
@@ -454,39 +487,6 @@ func BenchmarkSQLParallel(b *testing.B) {
454
487
})
455
488
}
456
489
457
- func BenchmarkSQLSerial (b * testing.B ) {
458
- // Tarantool supports SQL since version 2.0.0
459
- isLess , err := test_helpers .IsTarantoolVersionLess (2 , 0 , 0 )
460
- if err != nil {
461
- b .Fatal ("Could not check the Tarantool version" )
462
- }
463
- if isLess {
464
- b .Skip ()
465
- }
466
-
467
- conn , err := Connect (server , opts )
468
- if err != nil {
469
- b .Errorf ("Failed to connect: %s" , err )
470
- return
471
- }
472
- defer conn .Close ()
473
-
474
- spaceNo := 519
475
- _ , err = conn .Replace (spaceNo , []interface {}{uint (1111 ), "hello" , "world" })
476
- if err != nil {
477
- b .Errorf ("Failed to replace: %s" , err )
478
- }
479
-
480
- b .ResetTimer ()
481
- for i := 0 ; i < b .N ; i ++ {
482
- _ , err := conn .Execute ("SELECT NAME0,NAME1,NAME2 FROM SQL_TEST WHERE NAME0=?" , []interface {}{uint (1111 )})
483
- if err != nil {
484
- b .Errorf ("Select failed: %s" , err .Error ())
485
- break
486
- }
487
- }
488
- }
489
-
490
490
///////////////////
491
491
492
492
func TestClient (t * testing.T ) {
0 commit comments