Commit e0ac1e0
committed
Short-circuit when combining a registry with itself.
This is useful when combining some base registry with further
resources -- e.g. in jsonschema we do JSONSCHEMA_SPECS.combine(...)
and if no additional resources are provided that's meant to be a
no-op.
Doing this seems to be a huge speed-up, taking the test run from ~25s
to 9s (though even that is very slow compared to the non-compliant
implementation, so some performance optimization will come regardless).
But as a micro-optimization, this seems definitely useful.1 parent 09b273f commit e0ac1e0
2 files changed
+14
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
339 | 339 | | |
340 | 340 | | |
341 | 341 | | |
| 342 | + | |
| 343 | + | |
342 | 344 | | |
343 | 345 | | |
344 | 346 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
218 | 218 | | |
219 | 219 | | |
220 | 220 | | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
221 | 233 | | |
222 | 234 | | |
223 | 235 | | |
| |||
0 commit comments