There are much faster ways to generate Pythagorean triples.
Update: Now twice as fast.
genPTunder[lim_Integer?Positive] :=
Module[{prim},
prim =
Join @@ Table[
If[CoprimeQ[m, n], {2 m n, m^2 - n^2, m^2 + n^2}, ## &[]],
{m, 2, Floor @ Sqrt @ lim},
{n, 1 + m ~Mod~ 2, m, 2}
];
Union @@ (Range[lim ~Quotient~ Max@#] ~KroneckerProduct~ {Sort@#} & /@ prim)
]
genPTunder[50]
{{3, 4, 5}, {5, 12, 13}, {6, 8, 10}, {7, 24, 25}, {8, 15, 17},
{9, 12, 15}, {9, 40, 41}, {10, 24, 26}, {12, 16, 20}, {12, 35, 37},
{14, 48, 50}, {15, 20, 25}, {15, 36, 39}, {16, 30, 34}, {18, 24, 30},
{20, 21, 29}, {21, 28, 35}, {24, 32, 40}, {27, 36, 45}, {30, 40, 50}}
genPTunder[100000] // Length // Timing
{0.125, 161436}
Over 160,000 triples in an eighth of a second should be serviceable, even without compilation.