Performance optimization for LogEntry.isValid() by caching validation