Opened 5 years ago

Last modified 3 years ago

#14290 new patch

Patch: Do not create useless PurpleStatus-es for every PurplePresence

Reported by: hanzz Owned by: EionRobb
Milestone: Patches Needing Review Component: unclassified
Version: 2.8.0 Keywords:
Cc:

Description

Hi,

Current situation:

currently Libpurple creates PurpleStatus? for every PurpleStatusType? supported by particular prpl per every PurplePresence?. This wastes the memory, because most of PurpleBuddies? are a) offline, b) does not have mood/tune set, c) does not switch over *all* status-types during one session.

Solution:

Attached patch creates PurpleStatus? for specific PurpleStatusType? only when it's needed by prpl/UI.

Note that I changes semantics of purple_presence_get_status and purple_account_get_status functions and therefore it should be used probably in 3.x.y branch.

I will port it to 3.x.y as soon as I get monotone on this computer. This ticket is more about the idea itself then about having it in 2.8.x branch.

Stats:

For my single ICQ account (360 buddies) it saves 2MB. At work where I use more accounts with more buddies (lazy to count) it saves 8MB.

Attachments (1)

pidgin-2.8.0-statuses.patch (14.2 KB) - added by hanzz 5 years ago.

Download all attachments as: .zip

Change History (10)

Changed 5 years ago by hanzz

comment:1 Changed 5 years ago by Robby

  • Milestone set to Patches Needing Review

comment:2 Changed 5 years ago by QuLogic

  • Status changed from new to pending

Is there a reason why you needed purple_presence_init_status and couldn't just change purple_presence_get_status to return the same instance every time?

comment:3 Changed 5 years ago by trac-robot

  • Status changed from pending to closed

This ticket was closed automatically by the system. It was previously set to a Pending status and hasn't been updated within 14 days.

comment:4 Changed 5 years ago by QuLogic

  • Status changed from closed to new

comment:5 Changed 5 years ago by QuLogic

  • Status changed from new to pending

comment:6 Changed 5 years ago by trac-robot

  • Status changed from pending to closed

This ticket was closed automatically by the system. It was previously set to a Pending status and hasn't been updated within 14 days.

comment:7 Changed 5 years ago by Robby

  • Status changed from closed to new

comment:8 Changed 5 years ago by hanzz

If I remember well, it's because purple_presence_get_status needs const Presence, so it's not possible to create new status there. But You're probably right that if we change purple_presence_get_status definition, if would be possible to remove purple_presence_init_status

comment:9 Changed 3 years ago by rekkanoryo

  • Owner changed from rekkanoryo to EionRobb
Note: See TracTickets for help on using tickets.
All information, including names and email addresses, entered onto this website or sent to mailing lists affiliated with this website will be public. Do not post confidential information, especially passwords!