neilalexander / seaglass

A truly native Matrix client for macOS - written in Swift/Cocoa, with E2E encryption support
Other
529 stars 34 forks source link

Improve resizing performance #71

Closed aaronraimist closed 6 years ago

aaronraimist commented 6 years ago

TSMarkdownParser seems slow. Is it possible to not have this called on every redraw?


https://github.com/neilalexander/seaglass/blob/d991fe80846d36712a5ec01faba4d15b89115721/Seaglass/Subclass/Image%20Views/AvatarImageView.swift#L103

... or speed up create(withLetterString: String = "?") -> NSImage

If you just return startImage immediately in that method, resizing speeds up significantly (at least when only changing width) so that method seems to be slowing down resizing a lot.


screen shot 2018-09-13 at 12 19 02 am

aaronraimist commented 6 years ago

Wish GitHub gave regular people the ability to set milestones and tags but this is probably a least a post v0.1 thing.

neilalexander commented 6 years ago

I'll put this on v0.2 milestone for now as it's more of an optimisation thing rather than a get-it-to-work thing.

neilalexander commented 6 years ago

NSImage for avatars etc are now cached in memory so there may be some improvement there. I've also guarded against unnecessary table redraws when the drawn event hasn't changed in any way, so I'd be interested to understand if this improves things for you. At a first glance, resize performance has improved dramatically here.

aaronraimist commented 6 years ago

Yes I am quite happy with the performance in d3a661c, feel free to close this unless there is further stuff you want to track.

neilalexander commented 6 years ago

Good stuff - let’s reopen if we face any more performance issues in the future.