We consistently
- pre-allocate in Copy()
- merge the smaller into a copy of the larger in Merge()
This doesn't make much of a difference overall, since there are
comparatively few instances of these structures. But it costs little
in the code, and the consistency alone is worth it.
Pre-allocating slices really pays dividends when we create loads of
them and they don't grow very large.
We take special care to return nil rather than 0-length slices. This
a) saves further on allocation, and b) is required for some crude
tests to pass that match on nil rather than length.
Also, a bunch of code in templates/tables used slices as Maybe's,
i.e. returning nil or a single-element slice, which is horrendously
inefficient. Eliminating these saves a lot of allocations.
This isn't going to noticeably improve performance, but enables future
optimisations, e.g. more compact representations of LatestMaps where
many/all entries share the same timestamp.
This commit makes the LatestMap type a sort of a base class, that
should not be used directly. This also adds a generator for LatestMap
"concrete" types with a specific data type in the LatestEntry.
* Show k8s labels and container env vars in the details panel.
* Add show more bar to the env vars and labels
* React key was in the wrong place; empty tables render section labels.