Random data
longList = RandomInteger[100, {1000,5}];
Your solution
AbsoluteTiming[
Select[longList, #[[3]] == Min[longList[[All, 3]]] &]
]
(* {0.017431,{{100,81,0,36,91},{6,33,0,76,0},{9,9,0,19,16},{56,81,0,16,10},{72,31,0,9,3},{34,97,0,38,79},{53,93,0,32,37},{98,94,0,84,60}}}*)
My solution
Part, Position
AbsoluteTiming[
Part[#, Flatten@ Position[#[[All, 3]], Min[#[[All, 3]]]]]& @ longList
]
(* {0.000173,{{100,81,0,36,91},{6,33,0,76,0},{9,9,0,19,16},{56,81,0,16,10},{72,31,0,9,3},{34,97,0,38,79},{53,93,0,32,37},{98,94,0,84,60}}} *)
MinimalBy, Extract
MinimalBy[Extract[3]]@ longList
Benchmarks
theTrends =Transpose@Table[
With[
{longList = RandomInteger[100, {k,5}]},
{
{k, First@AbsoluteTiming@Select[longList, #[[3]] == Min[longList[[All, 3]]] &]}, (* OP *)
{k, First@AbsoluteTiming[Part[#, Flatten@ Position[#[[All, 3]], Min[#[[All, 3]]]]]& @ longList]}, (* rhermans *)
{k, First@AbsoluteTiming@MinimalBy[Extract[3]]@ longList}, (* rhermans *)
{k, First@AbsoluteTiming@Pick[longList, longList[[All, 3]], Min[longList[[All, 3]]]]}, (* "user1066" *)
{k, First@AbsoluteTiming[MinimalBy[longList, #[[3]] &]@longList]} (* PlatoManiac *)
}
]
,{k, PowerRange[2, 2^17, 2]}
];