pppoe connections to DNS static entry

ok I found this script, about doing it with DHCP, I managed to modify it for pppoe, and it works as expected, but it takes up 100% CPU and over 15 seconds to run for 230 users.

:local topdomain
:local hostname
:local hostip
:set topdomain "wifi.xxxx.ca" ;
/ppp active ;
:foreach i in=[find]  \
do={  \
    /ppp active 
        :if ([:len [get $i name]] > 0) do={  \
           :set hostname ([get $i name] . "-" . $topdomain); \
           :set hostip [get $i address]; \
           :put ( $hostname . " : " . $hostip ) ; \
          /ip dns static ; 
          :foreach di in=[find] do={ :if ([get $di name] = $hostname)  do={  /ip dns static remove $di}}
                 /ip dns static add name=$hostname address=$hostip
         }
};

is 100% cpu OK for this?
Will it really affect performance of a a xeon 3ghz router if I run this every 2 minutes or so?