Re: [Pharo-dev] Should Job use SystemAnnouncer?
Stef wrote:
did you notice a different between SystemAnnouncer and replacing it by another one?
Yes, it made a significant difference. It did not remove enough overhead though. Job>value: was called over 100K times, doing that only every 100 increments helped enough. Job>>jobAnnouncer ^jobAnnouncer ifNil: [ jobAnnouncer := Announcer new ] Job>announce: anAnnouncementClass | announcement | announcement := anAnnouncementClass on: self. self announcer announce: announcement. Job>announcer ^Job jobAnnouncer SystemProgressMorph>>enable Job jobAnnouncer on: JobStart send: #startJob: to: self. Job jobAnnouncer on: JobEnd send: #endJob: to: self. Job jobAnnouncer on: JobChange send: #updateJob: to: self. SystemProgressMorph>>disable Job jobAnnouncer unsubscribe: self. Morphic-StephanEggermont.1375.mcz Kernel-StephanEggermont.1351.mcz
On 2013-09-02, at 06:25, Stephan Eggermont <stephan@stack.nl> wrote:
Stef wrote:
did you notice a different between SystemAnnouncer and replacing it by another one?
Yes, it made a significant difference. It did not remove enough overhead though. Job>value: was called over 100K times, doing that only every 100 increments helped enough.
the main problem with the current progress bar morph design is that updates are forced whenever the underlying model (here job) changes. This is *very* costly for high-frequency updates, which is exactly the moment when you want to use the progress bar ;) It should work the other way around, the progress bar morph polls the underlying model with a given frequency (~10/s) and then refreshes the UI if the model changed.
participants (2)
-
Camillo Bruni -
Stephan Eggermont