Closed GoogleCodeExporter closed 9 years ago
Related: http://bugs.sun.com/view_bug.do?bug_id=4692504
Fixed:
https://code.google.com/p/omnifaces/source/detail?r=b3369a22688f8148caaa9dda4276
9a127bc95623
I made it a constant reference instead. Please try the attached snapshot.
Original comment by balusc
on 22 Apr 2013 at 3:12
Attachments:
Interesting/nice/perfect solutin! Since I've been making performance
improvement/changes throughout the app, this fix is definitely a lesson-learned
for me, and similar to changes that I have made in/throughout my app.
I downloaded the 1.5 snapshot JAR (that was attached to this issue), added to
the web app (project), and went through multiple pages throughout the web app,
and I am 'not' seeing this omnifaces EL function, formatDate, as a hotspot
anymore.
So, I'll take it (this fix). Thanks!
When is the class instantiated? I couldn't find it in jvisualvm's Call Tree at
all (after doing a sampler and then snapshot, and even after restarting tomee,
and starting sampler before login to the web app).
Original comment by smithh03...@gmail.com
on 22 Apr 2013 at 6:00
The Dates class is never instantiated. It contains only static methods (and has
a private constructor).
The TimeZone#getDefault() is --apparently-- instantiated on every call (I
initially didn't expect it to be, that was my mistake, I would otherwise have
made it a constant in first place, like as I already did for the UTC timezone).
It becomes a hostspot because the created instance represents the same value
everytime (as confirmed by equals()). It'd better be cached on application's
startup or as a constant reference.
Thank you for reporting this (keep reporting them) and good luck
fixing/enhancing your application's performance.
Original comment by balusc
on 22 Apr 2013 at 6:07
You're welcome and definitely, it is my pleasure to report this to you. I've
been reporting other 'hot spots' to PrimeFaces, OpenWebBeans, MyFaces as well.
Open-source at its best (reporting issues, especially performance issues). :)
Original comment by smithh03...@gmail.com
on 22 Apr 2013 at 6:11
Original issue reported on code.google.com by
smithh03...@gmail.com
on 22 Apr 2013 at 12:22Attachments: