Omit attributes when the value is an empty list or contains only nils - #910
Conversation
|
This looks good. I can benchmark it. Will need to disable the attribute cache to get a useful result. |
502e2bd to
bf827a8
Compare
|
I'm curious how you'll disable attribute caching. It looks like there's no interface for disabling it currently, and I wonder if swapping the FIFO cache out for a no-op "null cache" would suffice for benchmarking these types of changes. I'm also curious about the performance implications of edit: I did some benchmarking with a null cache and a modified
|
|
Sorry I haven’t got back to this yet. Should be able to give Phlex some attention next week and will hopefully get this merged. |
7d0ddef to
561aa6e
Compare
|
Rebased and moved changes into the new Here's what I used to benchmark: z1lk@e4c130f Seeing similar results as Let me know if you need anything from me, and also feel free to take over the branch if you'd like. (Not dying to get this merged, just checked in and saw this could be rebased.) |
|
Thank you. |
Implements #909. I haven't benchmarked this but I'm hopeful about it. Because
__attributes__implicitly discards nil via thecase valuestatement, we just have to make__nested_tokens__resolve to nil, which is accomplished by returning early on an empty buffer. We can handle nested arrays and sets, as well as nested attributes, by checking for that nil return value in places where we call__nested_tokens__.