# performance tuning – How to speed up integers finding function?

Playing with integers I looked for a way of finding, let’s say, $$4$$-digits positive integers such that $$a,b,a+b$$ had the same digits, like $$1089 + 8019 = 9108$$
I am a newbie and I used this function

``````sd[a_, b_] :=
If[Mod[a, 9] != 0 || Mod[b, 9] != 0 , False,
Sort[IntegerDigits[a + b]] == Sort[IntegerDigits[a]] &&
Sort[IntegerDigits[a]] == Sort[IntegerDigits[b]]]
``````

Then I used the function in this way

``````Select[Flatten[
Table[{h, k, sd[h, k]}, {h, 1000, 10000}, {k, h, 10000}], 1], #[[3]] &]
``````

But it took ages to give the output.

Is there a way to speed up this procedure?