[haiku-commits] Re: haiku: hrev51580 - src/apps/deskbar

  • From: looncraz <looncraz@xxxxxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Tue, 21 Nov 2017 10:18:14 -0600

On 11/21/2017 08:07, pulkomandy@xxxxxxxxxxxxx wrote:

hrev51580 adds 1 changeset to branch 'master'
old head: b06e48bb2b13b4d9e34da29b5e5f20e70a510b93
new head: 8c82d0edd5f7fc4996c8aebeb8870aa0ca224d12
overview: 
http://cgit.haiku-os.org/haiku/log/?qt=range&q=8c82d0edd5f7+%5Eb06e48bb2b13

----------------------------------------------------------------------------

8c82d0edd5f7: DeskBar: cache time and date formats
Creating BDateTimeFormat and BDateFormat objects is a costly operation
   (it loads locale data from ICU, etc). So, we should do it only once when
   the format changes, instead of doing it each time we format a date
   or time.



Maybe a system event should be triggered when locale or time formatting changes?  If that isn't done already, it should probably be done.  Then you can call UpdateTimeFormat() on a B_LOCALE_UPDATED message instead of potentially introducing a moment of lag (or doing unneeded work) when changing a simple thing like showing the date, time zone, or seconds...

I'm more than willing to do the work (today or tomorrow - I'm trying to get back into Haiku now that my big projects are finally done), if others agree it might be handy.  Going through the app_server and merging events like with B_COLORS_UPDATED, so scripted changes are merged and occur in controlled batches is second nature ;-)

--The loon

Other related posts: