improve rendering performance dramatically in certain situations

should resolve #770