The limiting factor is ventilation and "mildew" growth on the plant. I do peas 6" apart, double rows, about 4" apart - one on each side of a trellis panel. If peas were a longer season plants it would kill them. They're dying off about when they're done bearing pods, sometimes reducing our yield. We just plant more peas.
I've never trellised cucumbers. I think they would need quite a bit of space!