Mercurial > pidgin.yaz
annotate gaim.desktop @ 11719:109ee3bfeac5
[gaim-migrate @ 14010]
SF Patch #1333770 from corfe83
"Many times in gaim we use the function
g_slist_remove(list,node->data) to remove an element
from a GSList. If we already have the pointer to the
node we want to delete, it is faster to send it the
pointer to the node to delete rather than the data of
the node (we can do this by calling
g_slist_delete_link(list,node)). This change was made
while looking at glib's documentation and the code in
glib's gslist.c.
This is because as the remove/delete function traverses
each node in the list, it doesn't need to spend an
extra memory access to retrieve the data for each
element in the node it is traversing and then compare,
it can simply compare the pointer. In my tests outside
of gaim, this makes a big difference if the node you
are deleting is at a high index in the list. However,
even if you're deleting the first node, it about breaks
even.
So, I've found each case in gaim where we are calling
g_slist_remove, and we already have the pointer to the
appropriate node to delete (this is often the case when
we're doing a for or while loop on a GSList). I've then
replaced it with the appropriate call to
g_slist_delete_link. I, however, didn't do this in
situations where we are explicitly removing the first
element in the list, because in those situations it is
an unnecessary change.
There should be no difference in behavior, but just in
case I've tried running it with valgrind, which reports
the same number of memory leaks after my patch as
before my patch. Of course, I can't guarantee that my
normal behavior on gaim is hitting all the functions
I've changed, but in general testing it Works For Me (tm)."
As with the last patch, this one may not have a practical performance impact (or maybe it does, I have no idea), but it's not worse for any case. Given two ways of doing things where one is always at least as fast and may be faster under some cases, I like to prefer that faster way. This doesn't make the code any uglier, so I'm applying.
committer: Tailor Script <tailor@pidgin.im>
author | Richard Laager <rlaager@wiktel.com> |
---|---|
date | Sat, 22 Oct 2005 20:48:18 +0000 |
parents | 57e3e958ff49 |
children | 391acec18e46 |
rev | line source |
---|---|
325 | 1 [Desktop Entry] |
3726 | 2 Encoding=UTF-8 |
10971 | 3 Categories=Application;Network; |
4 Comment=Send instant messages over multiple protocols | |
5 Comment[da]=Send beskeder over flere protokoller | |
6 Comment[de]=Multi-Protokoll Instant Messenger Client | |
7 Comment[es]=Cliente de mensajería instantánea multiprotocolo | |
8 Comment[fr]=Client de messagerie instantanée multiprotocole | |
9 Comment[hu]=Többprotokollos üzenőkliens | |
10 Comment[it]=Client multiprotocollo per messaggi immediati | |
11 Comment[ko]=다중 프로토콜 메신저 | |
12 Comment[nb]=Send lynmeldinger over flere protokoller | |
13 Comment[nl]=Multi-protocol programma voor expresberichten | |
14 Comment[pl]=Komunikator internetowy obsługujący kilka protokołów | |
15 Comment[pt_BR]=Cliente multi-protocolo de mensagens | |
16 Comment[pt]=Envie mensagens instantâneas sobre vários protocolos | |
17 Comment[sl]=Večprotokolni odjemalec za neposredno sporočanje | |
18 Comment[sq]=Dërgoni mesazhe të atypëratyshëm protokollesh të ndryshëm | |
19 Comment[sv]=Sänder snabbmeddelande över många protokoll | |
20 Comment[zh_CN]=通过多种协议发送即时消息 | |
21 GenericName=Internet Messenger | |
22 GenericName[da]=Internet beskeder | |
23 GenericName[fr]=Messagerie instantanée | |
24 GenericName[hu]=IM | |
25 GenericName[it]=Internet Messenger | |
26 GenericName[ko]=메신저 | |
27 GenericName[nb]=Lynmeldingsklient | |
28 GenericName[nl]=Expresberichten | |
29 GenericName[pl]=Komunikator Internetowy | |
30 GenericName[pt_BR]=Mensageiro da Internet Gaim | |
31 GenericName[pt]=Mensageiro Internet | |
32 GenericName[sl]=Spletni sel | |
33 GenericName[sq]=Lajmësjellës Internet | |
34 GenericName[sv]=Meddelandeklient | |
35 GenericName[zh_CN]=互联网通讯程序 | |
9338 | 36 Name=Gaim Internet Messenger |
10539 | 37 Name[da]=Gaim - internet beskeder |
9349 | 38 Name[de]=Gaim Internet Messenger |
9344 | 39 Name[fr]=Gaim Messagerie Instantanée |
10821 | 40 Name[hu]=Gaim IM |
9361 | 41 Name[it]=Gaim Internet Messenger |
10539 | 42 Name[ko]=게임 메신저 |
10971 | 43 Name[nb]=Gaim lynmeldingsklient |
10539 | 44 Name[nl]=Gaim - Expresberichten |
9355 | 45 Name[pl]=Komunikator Internetowy Gaim |
10971 | 46 Name[pt]=Mensageiro Internet Gaim |
9844 | 47 Name[sl]=Gaim - spletni sel |
10971 | 48 Name[sq]=Lajmësjellësi Internet Gaim |
10539 | 49 Name[sv]=Gaim Internet Messenger |
10971 | 50 Name[zh_CN]=Gaim 互联网通讯程序 |
3726 | 51 Exec=gaim |
3364 | 52 Icon=gaim.png |
10971 | 53 StartupNotify=true |
3726 | 54 Terminal=false |
325 | 55 Type=Application |