dag: Speed up drawing performance