performance tuning – Finding if a number is perfect square

I used the following code to found if a specific number is a perfect square:

  If(IntegerQ(Sqrt( ...)), ..., Nothing), {..., ..., ...}) //. {} -> 

Mathematice can do this for numbers up to:


But my code is way, way too slow. Is there an other way to write the code in Mathematica that will be much faster?

I would accept a recommendation to use another programming language to find if a number is a perfect square for large values (like $10^{12}$ and bigger)? I know that ULLONG_MAX in C++ can handle values up to $18446744073709551615$. But code in C++ is slow for larger values. I also thought about using properties of square numbers in my program, but that means that I also need to compute the values.