Component Definition redraw takes too much time

I use:

$dc_observers.get_latest_class.redraw_with_undo(new_korpus_inst)

When I start Sketchup, load and change some DC and use $dc_observers… it takes about 0,3 sec.When I doing it once again (without start Skechup) it takes about 30sec!.
When I start Skechup again it takes 0,3 sec.
Redraw takes much more time after first use.
I can not explain it better but maybe you have same ideas where I should start looking…