Commit 88ed1af
committed
CASSGO-43: externally-defined type registration
The new RegisterType function can be used to register externally-defined
types. You'll need to define your own marshalling and unmarshalling code
as well as a TypeInfo implementation. The name and id MUST not collide
with existing and future native CQL types.
A lot of the type handling was refactored to use the new format for
native types.
Pointers to empty interfaces are accepted by Scan and are used to build
the maps in MapScan and SliceMap.
inet columns are now unmarshaled as net.IP which is a breaking change.
goos: linux
goarch: amd64
pkg: github.com/gocql/gocql
cpu: AMD EPYC 7B13
│ old.txt │ new.txt │
│ sec/op │ sec/op vs base │
SingleConn-16 25.92µ ± 1% 25.66µ ± 1% ~ (p=0.123 n=10)
ParseRowsFrame-16 1053.5n ± 2% 747.3n ± 3% -29.07% (p=0.000 n=10)
Unmarshal_BigInt-16 18.91n ± 0% 20.70n ± 1% +9.49% (p=0.000 n=10)
Unmarshal_Blob-16 19.38n ± 0% 21.92n ± 0% +13.08% (p=0.000 n=10)
Unmarshal_Boolean-16 16.57n ± 0% 18.80n ± 0% +13.45% (p=0.000 n=10)
Unmarshal_Date-16 18.48n ± 0% 20.98n ± 0% +13.53% (p=0.000 n=10)
Unmarshal_Decimal-16 196.5n ± 2% 209.1n ± 1% +6.44% (p=0.000 n=10)
Unmarshal_Double-16 16.27n ± 1% 18.77n ± 2% +15.37% (p=0.000 n=10)
Unmarshal_Duration-16 28.55n ± 0% 29.77n ± 1% +4.26% (p=0.000 n=10)
Unmarshal_Float-16 16.65n ± 1% 18.48n ± 1% +10.99% (p=0.000 n=10)
Unmarshal_Int-16 19.47n ± 1% 21.95n ± 1% +12.71% (p=0.000 n=10)
Unmarshal_Inet-16 30.28n ± 1% 38.32n ± 0% +26.53% (p=0.000 n=10)
Unmarshal_SmallInt-16 19.09n ± 0% 21.88n ± 0% +14.67% (p=0.000 n=10)
Unmarshal_Time-16 16.57n ± 0% 26.32n ± 1% +58.79% (p=0.000 n=10)
Unmarshal_Timestamp-16 16.60n ± 0% 18.43n ± 0% +11.02% (p=0.000 n=10)
Unmarshal_TinyInt-16 16.66n ± 0% 21.65n ± 1% +30.02% (p=0.000 n=10)
Unmarshal_UUID-16 17.87n ± 0% 19.74n ± 1% +10.46% (p=0.000 n=10)
Unmarshal_Varchar-16 18.77n ± 1% 21.93n ± 0% +16.84% (p=0.000 n=10)
Unmarshal_List-16 217.1n ± 0% 218.8n ± 2% ~ (p=0.108 n=10)
Unmarshal_Set-16 219.5n ± 1% 217.0n ± 0% -1.16% (p=0.000 n=10)
Unmarshal_Map-16 392.7n ± 1% 409.2n ± 2% +4.19% (p=0.000 n=10)
FramerReadTypeInfo-16 224.7n ± 4% 228.1n ± 1% ~ (p=0.159 n=10)
ConnStress-16 9.255µ ± 15%
ConnRoutingKey-16 178.4n ± 3%
WikiCreateSchema-16 520.9m ± 3%
WikiCreatePages-16 1.492m ± 1%
WikiSelectAllPages-16 1.959m ± 1%
WikiSelectSinglePage-16 1.496m ± 1%
WikiSelectPageCount-16 1.658m ± 2%
Unmarshal_TupleStrings-16 398.9n ± 2%
Unmarshal_TupleInterfaces-16 418.5n ± 1%
geomean 502.2n 72.59n +9.98% ¹
¹ benchmark set differs from baseline; geomeans may not be comparable
│ old.txt │ new.txt │
│ B/op │ B/op vs base │
SingleConn-16 3.110Ki ± 0% 3.110Ki ± 0% ~ (p=0.090 n=10)
ParseRowsFrame-16 1112.0 ± 0% 856.0 ± 0% -23.02% (p=0.000 n=10)
Unmarshal_BigInt-16 0.000 ± 0% 0.000 ± 0% ~ (p=1.000 n=10) ¹
Unmarshal_Blob-16 0.000 ± 0% 0.000 ± 0% ~ (p=1.000 n=10) ¹
Unmarshal_Boolean-16 0.000 ± 0% 0.000 ± 0% ~ (p=1.000 n=10) ¹
Unmarshal_Date-16 0.000 ± 0% 0.000 ± 0% ~ (p=1.000 n=10) ¹
Unmarshal_Decimal-16 96.00 ± 0% 96.00 ± 0% ~ (p=1.000 n=10) ¹
Unmarshal_Double-16 0.000 ± 0% 0.000 ± 0% ~ (p=1.000 n=10) ¹
Unmarshal_Duration-16 0.000 ± 0% 0.000 ± 0% ~ (p=1.000 n=10) ¹
Unmarshal_Float-16 0.000 ± 0% 0.000 ± 0% ~ (p=1.000 n=10) ¹
Unmarshal_Int-16 0.000 ± 0% 0.000 ± 0% ~ (p=1.000 n=10) ¹
Unmarshal_Inet-16 4.000 ± 0% 4.000 ± 0% ~ (p=1.000 n=10) ¹
Unmarshal_SmallInt-16 0.000 ± 0% 0.000 ± 0% ~ (p=1.000 n=10) ¹
Unmarshal_Time-16 0.000 ± 0% 0.000 ± 0% ~ (p=1.000 n=10) ¹
Unmarshal_Timestamp-16 0.000 ± 0% 0.000 ± 0% ~ (p=1.000 n=10) ¹
Unmarshal_TinyInt-16 0.000 ± 0% 0.000 ± 0% ~ (p=1.000 n=10) ¹
Unmarshal_UUID-16 0.000 ± 0% 0.000 ± 0% ~ (p=1.000 n=10) ¹
Unmarshal_Varchar-16 0.000 ± 0% 0.000 ± 0% ~ (p=1.000 n=10) ¹
Unmarshal_List-16 32.00 ± 0% 32.00 ± 0% ~ (p=1.000 n=10) ¹
Unmarshal_Set-16 32.00 ± 0% 32.00 ± 0% ~ (p=1.000 n=10) ¹
Unmarshal_Map-16 248.0 ± 0% 248.0 ± 0% ~ (p=1.000 n=10) ¹
FramerReadTypeInfo-16 160.00 ± 0% 96.00 ± 0% -40.00% (p=0.000 n=10)
ConnStress-16 2.670Ki ± 0%
ConnRoutingKey-16 32.00 ± 0%
WikiCreateSchema-16 53.38Ki ± 1%
WikiCreatePages-16 3.866Ki ± 0%
WikiSelectAllPages-16 28.74Ki ± 0%
WikiSelectSinglePage-16 3.305Ki ± 0%
WikiSelectPageCount-16 2.816Ki ± 0%
Unmarshal_TupleStrings-16 126.0 ± 0%
Unmarshal_TupleInterfaces-16 126.0 ± 0%
geomean ² -3.45% ³ ²
¹ all samples are equal
² summaries must be >0 to compute geomean
³ benchmark set differs from baseline; geomeans may not be comparable
│ old.txt │ new.txt │
│ allocs/op │ allocs/op vs base │
SingleConn-16 37.00 ± 0% 37.00 ± 0% ~ (p=1.000 n=10) ¹
ParseRowsFrame-16 21.00 ± 0% 13.00 ± 0% -38.10% (p=0.000 n=10)
Unmarshal_BigInt-16 0.000 ± 0% 0.000 ± 0% ~ (p=1.000 n=10) ¹
Unmarshal_Blob-16 0.000 ± 0% 0.000 ± 0% ~ (p=1.000 n=10) ¹
Unmarshal_Boolean-16 0.000 ± 0% 0.000 ± 0% ~ (p=1.000 n=10) ¹
Unmarshal_Date-16 0.000 ± 0% 0.000 ± 0% ~ (p=1.000 n=10) ¹
Unmarshal_Decimal-16 4.000 ± 0% 4.000 ± 0% ~ (p=1.000 n=10) ¹
Unmarshal_Double-16 0.000 ± 0% 0.000 ± 0% ~ (p=1.000 n=10) ¹
Unmarshal_Duration-16 0.000 ± 0% 0.000 ± 0% ~ (p=1.000 n=10) ¹
Unmarshal_Float-16 0.000 ± 0% 0.000 ± 0% ~ (p=1.000 n=10) ¹
Unmarshal_Int-16 0.000 ± 0% 0.000 ± 0% ~ (p=1.000 n=10) ¹
Unmarshal_Inet-16 1.000 ± 0% 1.000 ± 0% ~ (p=1.000 n=10) ¹
Unmarshal_SmallInt-16 0.000 ± 0% 0.000 ± 0% ~ (p=1.000 n=10) ¹
Unmarshal_Time-16 0.000 ± 0% 0.000 ± 0% ~ (p=1.000 n=10) ¹
Unmarshal_Timestamp-16 0.000 ± 0% 0.000 ± 0% ~ (p=1.000 n=10) ¹
Unmarshal_TinyInt-16 0.000 ± 0% 0.000 ± 0% ~ (p=1.000 n=10) ¹
Unmarshal_UUID-16 0.000 ± 0% 0.000 ± 0% ~ (p=1.000 n=10) ¹
Unmarshal_Varchar-16 0.000 ± 0% 0.000 ± 0% ~ (p=1.000 n=10) ¹
Unmarshal_List-16 2.000 ± 0% 2.000 ± 0% ~ (p=1.000 n=10) ¹
Unmarshal_Set-16 2.000 ± 0% 2.000 ± 0% ~ (p=1.000 n=10) ¹
Unmarshal_Map-16 5.000 ± 0% 5.000 ± 0% ~ (p=1.000 n=10) ¹
FramerReadTypeInfo-16 4.000 ± 0% 4.000 ± 0% ~ (p=1.000 n=10) ¹
ConnStress-16 33.00 ± 0%
ConnRoutingKey-16 3.000 ± 0%
WikiCreateSchema-16 773.0 ± 1%
WikiCreatePages-16 51.00 ± 2%
WikiSelectAllPages-16 338.0 ± 0%
WikiSelectSinglePage-16 45.00 ± 0%
WikiSelectPageCount-16 40.00 ± 0%
Unmarshal_TupleStrings-16 8.000 ± 0%
Unmarshal_TupleInterfaces-16 8.000 ± 0%
geomean ² -2.16% ³ ²
¹ all samples are equal
² summaries must be >0 to compute geomean
³ benchmark set differs from baseline; geomeans may not be comparable
Patch by James Hartig for CASSGO-431 parent 4ad7479 commit 88ed1af
15 files changed
+2692
-1217
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
| 13 | + | |
12 | 14 | | |
13 | 15 | | |
14 | 16 | | |
| |||
33 | 35 | | |
34 | 36 | | |
35 | 37 | | |
| 38 | + | |
| 39 | + | |
36 | 40 | | |
37 | 41 | | |
38 | 42 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
560 | 560 | | |
561 | 561 | | |
562 | 562 | | |
563 | | - | |
| 563 | + | |
564 | 564 | | |
565 | 565 | | |
566 | 566 | | |
| |||
983 | 983 | | |
984 | 984 | | |
985 | 985 | | |
986 | | - | |
| 986 | + | |
987 | 987 | | |
988 | 988 | | |
989 | 989 | | |
| |||
993 | 993 | | |
994 | 994 | | |
995 | 995 | | |
996 | | - | |
| 996 | + | |
997 | 997 | | |
998 | 998 | | |
999 | 999 | | |
| |||
1040 | 1040 | | |
1041 | 1041 | | |
1042 | 1042 | | |
1043 | | - | |
| 1043 | + | |
1044 | 1044 | | |
1045 | 1045 | | |
1046 | 1046 | | |
| |||
1072 | 1072 | | |
1073 | 1073 | | |
1074 | 1074 | | |
1075 | | - | |
| 1075 | + | |
1076 | 1076 | | |
1077 | 1077 | | |
1078 | | - | |
| 1078 | + | |
1079 | 1079 | | |
1080 | 1080 | | |
1081 | | - | |
| 1081 | + | |
1082 | 1082 | | |
1083 | 1083 | | |
1084 | | - | |
| 1084 | + | |
1085 | 1085 | | |
1086 | 1086 | | |
1087 | | - | |
| 1087 | + | |
1088 | 1088 | | |
1089 | 1089 | | |
1090 | | - | |
| 1090 | + | |
1091 | 1091 | | |
1092 | 1092 | | |
1093 | | - | |
| 1093 | + | |
1094 | 1094 | | |
1095 | 1095 | | |
1096 | | - | |
| 1096 | + | |
1097 | 1097 | | |
1098 | | - | |
1099 | | - | |
| 1098 | + | |
| 1099 | + | |
1100 | 1100 | | |
1101 | 1101 | | |
1102 | 1102 | | |
1103 | 1103 | | |
1104 | 1104 | | |
1105 | 1105 | | |
1106 | | - | |
| 1106 | + | |
1107 | 1107 | | |
1108 | 1108 | | |
1109 | 1109 | | |
1110 | | - | |
| 1110 | + | |
1111 | 1111 | | |
1112 | 1112 | | |
1113 | | - | |
| 1113 | + | |
1114 | 1114 | | |
1115 | 1115 | | |
1116 | | - | |
| 1116 | + | |
1117 | 1117 | | |
1118 | 1118 | | |
1119 | | - | |
| 1119 | + | |
| 1120 | + | |
| 1121 | + | |
| 1122 | + | |
| 1123 | + | |
| 1124 | + | |
| 1125 | + | |
| 1126 | + | |
| 1127 | + | |
| 1128 | + | |
| 1129 | + | |
| 1130 | + | |
| 1131 | + | |
| 1132 | + | |
| 1133 | + | |
| 1134 | + | |
| 1135 | + | |
| 1136 | + | |
| 1137 | + | |
| 1138 | + | |
| 1139 | + | |
| 1140 | + | |
| 1141 | + | |
| 1142 | + | |
| 1143 | + | |
| 1144 | + | |
| 1145 | + | |
| 1146 | + | |
| 1147 | + | |
| 1148 | + | |
| 1149 | + | |
| 1150 | + | |
| 1151 | + | |
| 1152 | + | |
| 1153 | + | |
| 1154 | + | |
| 1155 | + | |
| 1156 | + | |
| 1157 | + | |
| 1158 | + | |
| 1159 | + | |
| 1160 | + | |
| 1161 | + | |
| 1162 | + | |
| 1163 | + | |
| 1164 | + | |
| 1165 | + | |
| 1166 | + | |
| 1167 | + | |
| 1168 | + | |
| 1169 | + | |
| 1170 | + | |
| 1171 | + | |
| 1172 | + | |
| 1173 | + | |
1120 | 1174 | | |
1121 | 1175 | | |
1122 | 1176 | | |
| |||
1193 | 1247 | | |
1194 | 1248 | | |
1195 | 1249 | | |
1196 | | - | |
| 1250 | + | |
1197 | 1251 | | |
1198 | 1252 | | |
1199 | 1253 | | |
| |||
1513 | 1567 | | |
1514 | 1568 | | |
1515 | 1569 | | |
1516 | | - | |
1517 | | - | |
1518 | | - | |
| 1570 | + | |
1519 | 1571 | | |
1520 | 1572 | | |
1521 | 1573 | | |
| |||
2418 | 2470 | | |
2419 | 2471 | | |
2420 | 2472 | | |
2421 | | - | |
| 2473 | + | |
2422 | 2474 | | |
2423 | | - | |
| 2475 | + | |
2424 | 2476 | | |
2425 | | - | |
2426 | | - | |
2427 | 2477 | | |
2428 | | - | |
2429 | | - | |
| 2478 | + | |
| 2479 | + | |
2430 | 2480 | | |
2431 | 2481 | | |
2432 | 2482 | | |
| |||
2439 | 2489 | | |
2440 | 2490 | | |
2441 | 2491 | | |
2442 | | - | |
| 2492 | + | |
2443 | 2493 | | |
2444 | 2494 | | |
2445 | 2495 | | |
2446 | | - | |
| 2496 | + | |
2447 | 2497 | | |
2448 | 2498 | | |
2449 | 2499 | | |
| |||
2471 | 2521 | | |
2472 | 2522 | | |
2473 | 2523 | | |
2474 | | - | |
2475 | | - | |
2476 | 2524 | | |
2477 | | - | |
2478 | | - | |
| 2525 | + | |
| 2526 | + | |
2479 | 2527 | | |
2480 | 2528 | | |
2481 | | - | |
| 2529 | + | |
2482 | 2530 | | |
2483 | 2531 | | |
2484 | 2532 | | |
2485 | | - | |
2486 | | - | |
2487 | 2533 | | |
2488 | | - | |
2489 | | - | |
| 2534 | + | |
| 2535 | + | |
2490 | 2536 | | |
2491 | 2537 | | |
2492 | 2538 | | |
| |||
2503 | 2549 | | |
2504 | 2550 | | |
2505 | 2551 | | |
2506 | | - | |
2507 | | - | |
2508 | 2552 | | |
2509 | | - | |
2510 | | - | |
| 2553 | + | |
| 2554 | + | |
2511 | 2555 | | |
2512 | 2556 | | |
2513 | 2557 | | |
2514 | 2558 | | |
2515 | | - | |
| 2559 | + | |
2516 | 2560 | | |
2517 | 2561 | | |
2518 | 2562 | | |
2519 | 2563 | | |
2520 | 2564 | | |
2521 | | - | |
| 2565 | + | |
2522 | 2566 | | |
2523 | 2567 | | |
2524 | 2568 | | |
| |||
2621 | 2665 | | |
2622 | 2666 | | |
2623 | 2667 | | |
2624 | | - | |
2625 | | - | |
2626 | | - | |
2627 | | - | |
| 2668 | + | |
| 2669 | + | |
| 2670 | + | |
| 2671 | + | |
2628 | 2672 | | |
2629 | 2673 | | |
2630 | 2674 | | |
2631 | | - | |
| 2675 | + | |
2632 | 2676 | | |
2633 | 2677 | | |
2634 | 2678 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
236 | 236 | | |
237 | 237 | | |
238 | 238 | | |
239 | | - | |
| 239 | + | |
240 | 240 | | |
241 | 241 | | |
242 | 242 | | |
| |||
280 | 280 | | |
281 | 281 | | |
282 | 282 | | |
283 | | - | |
| 283 | + | |
284 | 284 | | |
285 | 285 | | |
286 | 286 | | |
287 | 287 | | |
288 | 288 | | |
289 | 289 | | |
290 | | - | |
| 290 | + | |
291 | 291 | | |
292 | 292 | | |
293 | 293 | | |
294 | 294 | | |
295 | 295 | | |
296 | 296 | | |
297 | | - | |
| 297 | + | |
298 | 298 | | |
299 | 299 | | |
0 commit comments