Commit 935382f
authored
perf: Optimize
## Which issue does this PR close?
- Closes #21723
## Rationale for this change
`DFSchema::qualified_name` shows up as a hotspot when profiling the
planner. It currently goes through the `fmt` machinery, which is fairly
slow; it is reasonably simple to avoid that and `write_str()` to a
preallocated string.
On the `sql_planner` benchmark, this yields 1-5% improvements for most
benchmarks, with no significant regressions.
## What changes are included in this PR?
* Implement optimization
* Add unit test to ensure that we preserve compatibility between
`qualified_name` and `TableReference::Display`
## Are these changes tested?
Yes.
## Are there any user-facing changes?
No.DFSchema::qualified_name (#21722)1 parent 8614308 commit 935382f
1 file changed
+67
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1338 | 1338 | | |
1339 | 1339 | | |
1340 | 1340 | | |
| 1341 | + | |
| 1342 | + | |
| 1343 | + | |
1341 | 1344 | | |
1342 | | - | |
1343 | | - | |
1344 | | - | |
1345 | | - | |
| 1345 | + | |
| 1346 | + | |
| 1347 | + | |
| 1348 | + | |
| 1349 | + | |
| 1350 | + | |
| 1351 | + | |
| 1352 | + | |
| 1353 | + | |
| 1354 | + | |
| 1355 | + | |
| 1356 | + | |
| 1357 | + | |
| 1358 | + | |
| 1359 | + | |
| 1360 | + | |
| 1361 | + | |
| 1362 | + | |
| 1363 | + | |
| 1364 | + | |
| 1365 | + | |
| 1366 | + | |
| 1367 | + | |
| 1368 | + | |
| 1369 | + | |
| 1370 | + | |
| 1371 | + | |
| 1372 | + | |
| 1373 | + | |
| 1374 | + | |
| 1375 | + | |
| 1376 | + | |
| 1377 | + | |
| 1378 | + | |
1346 | 1379 | | |
1347 | 1380 | | |
1348 | 1381 | | |
| |||
1351 | 1384 | | |
1352 | 1385 | | |
1353 | 1386 | | |
| 1387 | + | |
| 1388 | + | |
| 1389 | + | |
| 1390 | + | |
| 1391 | + | |
| 1392 | + | |
| 1393 | + | |
| 1394 | + | |
| 1395 | + | |
| 1396 | + | |
| 1397 | + | |
| 1398 | + | |
| 1399 | + | |
| 1400 | + | |
| 1401 | + | |
| 1402 | + | |
| 1403 | + | |
| 1404 | + | |
| 1405 | + | |
| 1406 | + | |
| 1407 | + | |
| 1408 | + | |
| 1409 | + | |
| 1410 | + | |
| 1411 | + | |
| 1412 | + | |
| 1413 | + | |
| 1414 | + | |
| 1415 | + | |
| 1416 | + | |
1354 | 1417 | | |
1355 | 1418 | | |
1356 | 1419 | | |
| |||
0 commit comments