Commit f0cded4
committed
CASSGO-43: externally-defined type registration
The new RegisteredTypes struct 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
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 │ new2.txt │
│ sec/op │ sec/op vs base │
SingleConn-16 25.87µ ± 2% 25.65µ ± 1% ~ (p=0.280 n=10)
ParseRowsFrame-16 870.5n ± 3% 634.6n ± 4% -27.10% (p=0.000 n=10)
UnmarshalVarchar-16 47.29n ± 2%
UnmarshalUUID-16 3.161n ± 2%
Unmarshal_BigInt-16 17.61n ± 9% 17.88n ± 0% ~ (p=0.138 n=10)
Unmarshal_Blob-16 19.19n ± 0% 18.69n ± 0% -2.61% (p=0.000 n=10)
Unmarshal_Boolean-16 15.71n ± 0% 16.16n ± 1% +2.90% (p=0.000 n=10)
Unmarshal_Date-16 18.53n ± 1% 18.64n ± 0% +0.59% (p=0.017 n=10)
Unmarshal_Decimal-16 172.2n ± 2% 181.3n ± 1% +5.32% (p=0.000 n=10)
Unmarshal_Double-16 16.33n ± 1% 16.20n ± 1% -0.77% (p=0.003 n=10)
Unmarshal_Duration-16 26.03n ± 1% 25.05n ± 0% -3.77% (p=0.000 n=10)
Unmarshal_Float-16 15.70n ± 0% 15.90n ± 1% +1.31% (p=0.001 n=10)
Unmarshal_Int-16 17.80n ± 1% 18.78n ± 2% +5.48% (p=0.000 n=10)
Unmarshal_Inet-16 28.68n ± 1% 29.20n ± 1% +1.78% (p=0.001 n=10)
Unmarshal_SmallInt-16 17.92n ± 1% 19.37n ± 2% +8.09% (p=0.000 n=10)
Unmarshal_Time-16 16.00n ± 1% 16.22n ± 1% +1.37% (p=0.001 n=10)
Unmarshal_Timestamp-16 16.00n ± 2% 16.57n ± 2% +3.50% (p=0.000 n=10)
Unmarshal_TinyInt-16 16.38n ± 3% 18.41n ± 1% +12.39% (p=0.000 n=10)
Unmarshal_UUID-16 16.05n ± 1% 16.34n ± 3% +1.74% (p=0.000 n=10)
Unmarshal_Varchar-16 18.86n ± 1% 18.71n ± 1% -0.77% (p=0.003 n=10)
Unmarshal_List-16 176.2n ± 4% 183.2n ± 4% +3.97% (p=0.003 n=10)
Unmarshal_Set-16 177.7n ± 1% 181.5n ± 0% +2.17% (p=0.000 n=10)
Unmarshal_Map-16 374.0n ± 5% 375.2n ± 4% ~ (p=0.218 n=10)
FramerReadTypeInfo-16 207.8n ± 3% 214.9n ± 2% +3.44% (p=0.002 n=10)
ConnStress-16 14.10µ ± 16% 15.20µ ± 14% ~ (p=0.631 n=10)
ConnRoutingKey-16 275.3n ± 4% 197.8n ± 2% -28.17% (p=0.000 n=10)
WikiCreateSchema-16 515.9m ± 3% 501.4m ± 3% -2.81% (p=0.011 n=10)
WikiCreatePages-16 1.534m ± 1% 1.474m ± 1% -3.90% (p=0.000 n=10)
WikiSelectAllPages-16 1.982m ± 3% 1.906m ± 3% -3.84% (p=0.000 n=10)
WikiSelectSinglePage-16 1.529m ± 2% 1.479m ± 1% -3.27% (p=0.000 n=10)
WikiSelectPageCount-16 1.691m ± 2% 1.646m ± 1% -2.63% (p=0.001 n=10)
Unmarshal_TupleStrings-16 329.6n ± 1%
Unmarshal_TupleInterfaces-16 357.9n ± 3%
geomean 387.3n 475.8n -0.98% ¹
¹ benchmark set differs from baseline; geomeans may not be comparable
│ old.txt │ new2.txt │
│ B/op │ B/op vs base │
SingleConn-16 3.155Ki ± 0% 3.109Ki ± 0% -1.45% (p=0.000 n=10)
ParseRowsFrame-16 1128.0 ± 0% 856.0 ± 0% -24.11% (p=0.000 n=10)
UnmarshalVarchar-16 32.00 ± 0%
UnmarshalUUID-16 0.000 ± 0%
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 280.0 ± 0% 280.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.956Ki ± 0% 2.669Ki ± 0% -9.70% (p=0.001 n=10)
ConnRoutingKey-16 96.00 ± 0% 32.00 ± 0% -66.67% (p=0.000 n=10)
WikiCreateSchema-16 59.90Ki ± 3% 51.87Ki ± 4% -13.41% (p=0.000 n=10)
WikiCreatePages-16 4.357Ki ± 0% 3.864Ki ± 0% -11.33% (p=0.000 n=10)
WikiSelectAllPages-16 38.32Ki ± 0% 28.74Ki ± 0% -25.01% (p=0.000 n=10)
WikiSelectSinglePage-16 3.783Ki ± 0% 3.303Ki ± 0% -12.69% (p=0.000 n=10)
WikiSelectPageCount-16 3.215Ki ± 0% 2.816Ki ± 0% -12.42% (p=0.000 n=10)
Unmarshal_TupleStrings-16 126.0 ± 0%
Unmarshal_TupleInterfaces-16 126.0 ± 0%
geomean ² -9.27% ³ ²
¹ all samples are equal
² summaries must be >0 to compute geomean
³ benchmark set differs from baseline; geomeans may not be comparable
│ old.txt │ new2.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)
UnmarshalVarchar-16 1.000 ± 0%
UnmarshalUUID-16 0.000 ± 0%
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 35.00 ± 0% 33.00 ± 0% -5.71% (p=0.000 n=10)
ConnRoutingKey-16 4.000 ± 0% 3.000 ± 0% -25.00% (p=0.000 n=10)
WikiCreateSchema-16 858.0 ± 3% 654.5 ± 4% -23.72% (p=0.000 n=10)
WikiCreatePages-16 56.00 ± 2% 51.00 ± 0% -8.93% (p=0.000 n=10)
WikiSelectAllPages-16 343.0 ± 0% 338.0 ± 0% -1.46% (p=0.000 n=10)
WikiSelectSinglePage-16 50.00 ± 0% 45.00 ± 0% -10.00% (p=0.000 n=10)
WikiSelectPageCount-16 45.00 ± 0% 40.00 ± 0% -11.11% (p=0.000 n=10)
Unmarshal_TupleStrings-16 8.000 ± 0%
Unmarshal_TupleInterfaces-16 8.000 ± 0%
geomean ² -4.81% ³ ²
¹ 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 0551773 commit f0cded4
File tree
22 files changed
+3347
-2100
lines changed22 files changed
+3347
-2100
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
| 22 | + | |
21 | 23 | | |
22 | 24 | | |
23 | 25 | | |
| |||
56 | 58 | | |
57 | 59 | | |
58 | 60 | | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
59 | 65 | | |
60 | 66 | | |
61 | 67 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
645 | 645 | | |
646 | 646 | | |
647 | 647 | | |
648 | | - | |
| 648 | + | |
649 | 649 | | |
650 | 650 | | |
651 | 651 | | |
| |||
1068 | 1068 | | |
1069 | 1069 | | |
1070 | 1070 | | |
1071 | | - | |
| 1071 | + | |
1072 | 1072 | | |
1073 | 1073 | | |
1074 | 1074 | | |
| |||
1078 | 1078 | | |
1079 | 1079 | | |
1080 | 1080 | | |
1081 | | - | |
| 1081 | + | |
1082 | 1082 | | |
1083 | 1083 | | |
1084 | 1084 | | |
| |||
1125 | 1125 | | |
1126 | 1126 | | |
1127 | 1127 | | |
1128 | | - | |
| 1128 | + | |
1129 | 1129 | | |
1130 | 1130 | | |
1131 | 1131 | | |
| |||
1157 | 1157 | | |
1158 | 1158 | | |
1159 | 1159 | | |
1160 | | - | |
| 1160 | + | |
1161 | 1161 | | |
1162 | 1162 | | |
1163 | | - | |
| 1163 | + | |
1164 | 1164 | | |
1165 | 1165 | | |
1166 | | - | |
| 1166 | + | |
1167 | 1167 | | |
1168 | 1168 | | |
1169 | | - | |
| 1169 | + | |
1170 | 1170 | | |
1171 | 1171 | | |
1172 | | - | |
| 1172 | + | |
1173 | 1173 | | |
1174 | 1174 | | |
1175 | | - | |
| 1175 | + | |
1176 | 1176 | | |
1177 | 1177 | | |
1178 | | - | |
| 1178 | + | |
1179 | 1179 | | |
1180 | 1180 | | |
1181 | | - | |
| 1181 | + | |
1182 | 1182 | | |
1183 | | - | |
1184 | | - | |
| 1183 | + | |
| 1184 | + | |
1185 | 1185 | | |
1186 | 1186 | | |
1187 | 1187 | | |
1188 | 1188 | | |
1189 | 1189 | | |
1190 | 1190 | | |
1191 | | - | |
| 1191 | + | |
1192 | 1192 | | |
1193 | 1193 | | |
1194 | 1194 | | |
1195 | | - | |
| 1195 | + | |
1196 | 1196 | | |
1197 | 1197 | | |
1198 | | - | |
| 1198 | + | |
1199 | 1199 | | |
1200 | 1200 | | |
1201 | | - | |
| 1201 | + | |
1202 | 1202 | | |
1203 | 1203 | | |
1204 | | - | |
| 1204 | + | |
| 1205 | + | |
| 1206 | + | |
| 1207 | + | |
| 1208 | + | |
| 1209 | + | |
| 1210 | + | |
| 1211 | + | |
| 1212 | + | |
| 1213 | + | |
| 1214 | + | |
| 1215 | + | |
| 1216 | + | |
| 1217 | + | |
| 1218 | + | |
| 1219 | + | |
| 1220 | + | |
| 1221 | + | |
| 1222 | + | |
| 1223 | + | |
| 1224 | + | |
| 1225 | + | |
| 1226 | + | |
| 1227 | + | |
| 1228 | + | |
| 1229 | + | |
| 1230 | + | |
| 1231 | + | |
| 1232 | + | |
| 1233 | + | |
| 1234 | + | |
| 1235 | + | |
| 1236 | + | |
| 1237 | + | |
| 1238 | + | |
| 1239 | + | |
| 1240 | + | |
| 1241 | + | |
| 1242 | + | |
| 1243 | + | |
| 1244 | + | |
| 1245 | + | |
| 1246 | + | |
| 1247 | + | |
| 1248 | + | |
| 1249 | + | |
| 1250 | + | |
| 1251 | + | |
| 1252 | + | |
| 1253 | + | |
| 1254 | + | |
| 1255 | + | |
| 1256 | + | |
| 1257 | + | |
| 1258 | + | |
1205 | 1259 | | |
1206 | 1260 | | |
1207 | 1261 | | |
| |||
1278 | 1332 | | |
1279 | 1333 | | |
1280 | 1334 | | |
1281 | | - | |
| 1335 | + | |
1282 | 1336 | | |
1283 | 1337 | | |
1284 | 1338 | | |
| |||
1598 | 1652 | | |
1599 | 1653 | | |
1600 | 1654 | | |
1601 | | - | |
| 1655 | + | |
1602 | 1656 | | |
1603 | 1657 | | |
1604 | 1658 | | |
| |||
2515 | 2569 | | |
2516 | 2570 | | |
2517 | 2571 | | |
2518 | | - | |
2519 | 2572 | | |
2520 | 2573 | | |
2521 | 2574 | | |
2522 | | - | |
| 2575 | + | |
2523 | 2576 | | |
2524 | | - | |
| 2577 | + | |
2525 | 2578 | | |
2526 | | - | |
2527 | | - | |
2528 | 2579 | | |
2529 | | - | |
2530 | | - | |
| 2580 | + | |
| 2581 | + | |
| 2582 | + | |
| 2583 | + | |
2531 | 2584 | | |
2532 | 2585 | | |
2533 | 2586 | | |
| |||
2540 | 2593 | | |
2541 | 2594 | | |
2542 | 2595 | | |
2543 | | - | |
| 2596 | + | |
2544 | 2597 | | |
2545 | 2598 | | |
2546 | 2599 | | |
2547 | | - | |
| 2600 | + | |
2548 | 2601 | | |
2549 | 2602 | | |
2550 | 2603 | | |
| |||
2566 | 2619 | | |
2567 | 2620 | | |
2568 | 2621 | | |
2569 | | - | |
2570 | 2622 | | |
2571 | 2623 | | |
2572 | 2624 | | |
2573 | 2625 | | |
2574 | 2626 | | |
2575 | 2627 | | |
2576 | | - | |
2577 | | - | |
2578 | 2628 | | |
2579 | | - | |
2580 | | - | |
| 2629 | + | |
| 2630 | + | |
| 2631 | + | |
| 2632 | + | |
2581 | 2633 | | |
2582 | 2634 | | |
2583 | | - | |
| 2635 | + | |
2584 | 2636 | | |
2585 | 2637 | | |
2586 | 2638 | | |
2587 | | - | |
2588 | | - | |
2589 | 2639 | | |
2590 | | - | |
2591 | | - | |
| 2640 | + | |
| 2641 | + | |
| 2642 | + | |
| 2643 | + | |
2592 | 2644 | | |
2593 | 2645 | | |
2594 | 2646 | | |
| |||
2605 | 2657 | | |
2606 | 2658 | | |
2607 | 2659 | | |
2608 | | - | |
2609 | | - | |
2610 | 2660 | | |
2611 | | - | |
2612 | | - | |
| 2661 | + | |
| 2662 | + | |
| 2663 | + | |
| 2664 | + | |
2613 | 2665 | | |
2614 | 2666 | | |
2615 | 2667 | | |
2616 | 2668 | | |
2617 | | - | |
| 2669 | + | |
2618 | 2670 | | |
2619 | 2671 | | |
2620 | 2672 | | |
2621 | 2673 | | |
2622 | 2674 | | |
2623 | | - | |
| 2675 | + | |
2624 | 2676 | | |
2625 | 2677 | | |
2626 | 2678 | | |
| |||
2718 | 2770 | | |
2719 | 2771 | | |
2720 | 2772 | | |
2721 | | - | |
2722 | 2773 | | |
2723 | 2774 | | |
2724 | 2775 | | |
2725 | 2776 | | |
2726 | 2777 | | |
2727 | | - | |
2728 | | - | |
2729 | | - | |
2730 | | - | |
| 2778 | + | |
| 2779 | + | |
| 2780 | + | |
| 2781 | + | |
| 2782 | + | |
| 2783 | + | |
| 2784 | + | |
| 2785 | + | |
| 2786 | + | |
| 2787 | + | |
2731 | 2788 | | |
2732 | 2789 | | |
2733 | 2790 | | |
2734 | | - | |
| 2791 | + | |
2735 | 2792 | | |
2736 | 2793 | | |
2737 | 2794 | | |
| |||
3542 | 3599 | | |
3543 | 3600 | | |
3544 | 3601 | | |
3545 | | - | |
| 3602 | + | |
3546 | 3603 | | |
3547 | | - | |
| 3604 | + | |
3548 | 3605 | | |
3549 | 3606 | | |
3550 | 3607 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
274 | 274 | | |
275 | 275 | | |
276 | 276 | | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
277 | 281 | | |
278 | 282 | | |
279 | 283 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
245 | 245 | | |
246 | 246 | | |
247 | 247 | | |
248 | | - | |
| 248 | + | |
249 | 249 | | |
250 | 250 | | |
251 | 251 | | |
| |||
297 | 297 | | |
298 | 298 | | |
299 | 299 | | |
300 | | - | |
| 300 | + | |
301 | 301 | | |
302 | 302 | | |
303 | 303 | | |
304 | 304 | | |
305 | 305 | | |
306 | 306 | | |
307 | | - | |
| 307 | + | |
308 | 308 | | |
309 | 309 | | |
310 | 310 | | |
311 | 311 | | |
312 | 312 | | |
313 | 313 | | |
314 | | - | |
| 314 | + | |
315 | 315 | | |
316 | 316 | | |
0 commit comments