• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Logging through AOP

 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
does logging through AOP in production environment increase any performance .If yes how?.Interceptors intercept the thread and "pause" it for sometime .so how does it can affect performance .?
 
Sheriff
Posts: 5555
326
IntelliJ IDE Python Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The best way for you to get a definitive answer to your question is to try it for yourself. It would be easy enough to write a small test application to measure the performance of two identical operations, where one logs directly from the method, and the other logs from an AOP pointcut.

In my experience, logging is normally way down the list of performance bottlenecks so I if you are having performance concerns then I would it's likely that there are larger improvements to be made elsewhere.

Let us know how you get on with your performance testing app.
 
suraj august
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I could not see any performance gain.But just needed to ask whether we can configure it any way which can have a performance benefit.
 
Tim Cooke
Sheriff
Posts: 5555
326
IntelliJ IDE Python Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

suraj aryan wrote:I could not see any performance gain.


There you are, you've answered your own question.

I would consider AOP a tool to help me separate concerns in my code. Uncle Bob Martin, in his Clean Code book, says that your functions should "do one thing and do it well", he goes on to point out that logging is one thing, therefore AOP allows you to separate out the logging concern leaving your method clean to do its one thing only.

I would never consider AOP a tool to increase performance.
 
Where does a nanny get ground to air missles? Protect this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic