I was reading this stack overflow post on fast ways to check if a number is a perfect square in Python. It seems that my own version from here based on binary search might be faster than the proposed solutions. (It passes this test in 0.007768 seconds on my laptop.) I just wanted to leave it here in case people find it useful.

```
def is_square(num):
"""Return True iff num is a perfect square."""
if num <= 0:
return num == 0
lo = 10**((len(str(num))-1)//2)
hi = lo * 10
while lo <= hi:
mid = lo + (hi-lo)//2
if mid * mid == num:
return True
if mid * mid < num:
lo = mid + 1
else:
hi = mid - 1
return False
```