Repository navigation
Commit 6cc522a
Catalog: build each function listing once and encode each item once
A function listing is derived only from the registered classes' static
metadata, yet every catalog_schema_contents_functions request rebuilt
it: every function in the schema was turned into a FunctionInfo (to
keep the requested type's) and the worker Arrow-encoded each kept one
again, about 0.8 ms per function. The example worker's 162 table
functions cost 134 ms of worker time per listing; DuckDB pays the same
for every function-set load. In the test suite these listings were half
of the shared launched worker's busy time, and the listing tests queued
behind each other on it.
CatalogInterface now keeps each (schema, listing type) result, built on
first request, so it returns the same FunctionInfo instances every
time. FunctionsResponse.from_infos (and the other catalog item
responses) store an item's encoding on the instance, the way
functools.cached_property does on a frozen dataclass, so an instance is
encoded once. Catalogs that build fresh items per call are unaffected.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>1 parent 96d15b2 commit 6cc522a
2 files changed
Lines changed: 73 additions & 22 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2698 | 2698 | | |
2699 | 2699 | | |
2700 | 2700 | | |
| 2701 | + | |
| 2702 | + | |
2701 | 2703 | | |
2702 | 2704 | | |
2703 | 2705 | | |
| |||
2738 | 2740 | | |
2739 | 2741 | | |
2740 | 2742 | | |
| 2743 | + | |
2741 | 2744 | | |
2742 | 2745 | | |
2743 | 2746 | | |
| |||
3320 | 3323 | | |
3321 | 3324 | | |
3322 | 3325 | | |
3323 | | - | |
3324 | | - | |
3325 | | - | |
3326 | | - | |
3327 | | - | |
3328 | | - | |
3329 | | - | |
3330 | | - | |
3331 | | - | |
3332 | | - | |
3333 | | - | |
3334 | | - | |
3335 | | - | |
3336 | | - | |
3337 | | - | |
3338 | | - | |
3339 | | - | |
3340 | | - | |
3341 | | - | |
3342 | | - | |
| 3326 | + | |
| 3327 | + | |
3343 | 3328 | | |
3344 | 3329 | | |
3345 | 3330 | | |
| 3331 | + | |
| 3332 | + | |
| 3333 | + | |
| 3334 | + | |
| 3335 | + | |
| 3336 | + | |
| 3337 | + | |
| 3338 | + | |
| 3339 | + | |
| 3340 | + | |
| 3341 | + | |
| 3342 | + | |
| 3343 | + | |
| 3344 | + | |
| 3345 | + | |
| 3346 | + | |
| 3347 | + | |
| 3348 | + | |
| 3349 | + | |
| 3350 | + | |
| 3351 | + | |
| 3352 | + | |
| 3353 | + | |
| 3354 | + | |
| 3355 | + | |
| 3356 | + | |
| 3357 | + | |
| 3358 | + | |
| 3359 | + | |
| 3360 | + | |
| 3361 | + | |
| 3362 | + | |
| 3363 | + | |
| 3364 | + | |
| 3365 | + | |
3346 | 3366 | | |
3347 | 3367 | | |
3348 | 3368 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
843 | 843 | | |
844 | 844 | | |
845 | 845 | | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
846 | 877 | | |
847 | 878 | | |
848 | 879 | | |
| |||
869 | 900 | | |
870 | 901 | | |
871 | 902 | | |
872 | | - | |
| 903 | + | |
873 | 904 | | |
874 | 905 | | |
875 | 906 | | |
876 | 907 | | |
877 | 908 | | |
878 | | - | |
| 909 | + | |
879 | 910 | | |
880 | 911 | | |
881 | 912 | | |
| |||
0 commit comments