Use numpy to lower cpu load