I've a Servlet filter which performs the following type cast:
HttpServletRequest httpRequest = (HttpServletRequest) req;
At present my filter is responsible for two tasks that would be better separated into two filters. If I'd split the logic into two filters I'd need two casts.
What is the performance impact of such a cast? Is it worth to accept this performance degradation for a better architecture?