basic performance improvements on string comparison