Dynamic Proxy frameworks comparison: update

After my post com­par­ing dif­fer­ent dynamic proxy frame­works, many peo­ple were sur­prised by the poor per­for­mance of LinFu.DynamicProxy frame­work. In the update I noted that it was gath­er­ing the stack trace for each inter­cepted call, that made the frame­work so slow.

Philip, the author of LinFu updated the frame­work, remov­ing usage of Stack­Trace. It made a dras­tic change in the per­for­mance, and my pre­vi­ous com­par­i­son no longer cor­re­spond to cur­rent char­ac­ter­is­tics of the framework.

As such I decided to re-run the test. Here are the results:


All the times are roughly 10% bet­ter than the last time, which is due to inter­fer­ence from other processes on my machine. What is impor­tant is the rel­a­tive val­ues between frame­works. As we can see LinFu is now a lot faster – the change yielded over x20 per­for­mance improve­ment, mak­ing it almost as fast as spring, and twice as fast as Unity.

I still didn’t invoke prox­ied method. With LinFu cur­rently the only way I’m aware of is doing it via MethodInfo.Invoke, which is rel­a­tively slow, but judg­ing from Philip’s tweets, it will be addressed soon as well.

Tech­no­rati Tags: ,