Re: Performance tuning

Splash Forums Rewrite Users Performance tuning Re: Performance tuning



Lincoln, your improvements are great, time droped from 177 ms to 73 ms.

I noticed that you created RuleCacheProvider and I tried it with this simple implementation:

public class SimpleRuleCacheProvider implements RuleCacheProvider {
private Map<Object, List<Rule>> cachedRules = new ConcurrentLinkedHashMap.Builder<Object, List<Rule>>()

public List<Rule> get(Object key) {
return cachedRules.get(key);

public void put(Object key, List<Rule> rules) {
cachedRules.put(key, rules);

public Object createKey(Rewrite event, EvaluationContext context) {
if (event instanceof HttpInboundServletRewrite) {
HttpInboundServletRewrite evt = (HttpInboundServletRewrite) event;

return evt.getRequest().getRequestURI();
} else if (event instanceof HttpOutboundServletRewrite) {
HttpOutboundServletRewrite evt = (HttpOutboundServletRewrite) event;

return evt.getOriginalOutboundURL();

return null;

It’s a naive approach but should be effective. With this provider, time dropped to 41 ms.

With higher concurrency and more complex pages, rewrite overhead is still noticeable (with concurreny set to 100, application with rewrite is about 50% slower). But thanks for all optimizations that you have done so far, performance improvements in 2.0.0-SNAPSHOT are massive and puts 1.1.0-Final version to shame :-)