java.net.InetAddress ia = InetAddress.getByName("192.168.100.100");
System.out.println(System.currentTimeMillis());
ia.getHostName(); // 很慢
System.out.println(System.currentTimeMillis());
ia.getHostAddress(); // 很快
System.out.println(System.currentTimeMillis());


/**
* Roster item cache - table: key jabberid string; value roster item.
*/
protected ConcurrentHashMap<String, RosterItem> rosterItems =
new ConcurrentHashMap<String, RosterItem>();


(Jabberd 1.4 更新好友列表的代码, mod_presence.cc)
/**
* remove a jid from a list, returning the new list
*
* @param id the JabberID that should be removed
* @param ids the list of JabberIDs
* @return the new list
*/
static jid _mod_presence_whack(jid id, jid ids) {
jid curr;
if (id == NULL || ids == NULL)
return NULL;
/* check first */
if (jid_cmp(id,ids) == 0)
return ids->next;
/* check through the list, stopping at the previous list entry to a matching one */
for (curr = ids; curr != NULL; curr = curr->next) {
if (jid_cmp(curr->next, id) == 0)
break;
}
/* clip it out if found */
if(curr != NULL)
curr->next = curr->next->next;
return ids;
}