Performance issue in Resource binding and xmpp session

function bindResourceAndEstablishSession

Smack/AbstractXMPPConnection.java at master · igniterealtime/Smack · GitHub

line 520

The packet collector for session and resource binding are making the library bit slow.

If I set legacySessionDisabled = true, then the library works faster.

I’m not sure if you are reporting a issue with the library or just stating the fact that having a extra roundtrip by using legacy session establishing makes the login take longer.

I am jjust stating a fact that… if the legacy session is enabled then all the packet lifecycle like sending presence, receiving messages, sending a ping… all are affected with a lesser performance.

That’s news to me, and I can hardly imaginable that this is a side effect (which is caused within Smack). On the other hand, I can’t rule it out. What’s needed is further information and analysis

Maybe it’s because the PacketCollector isn’t canceled, after usage, i.e.

try {

packetCollector = createPacketCollectorAndSend(new StanzaIdFilter(session), session);

packetCollector.nextResultOrThrow();

} finally {

packetCollector.cancel();

}

Just a vague idea, maybe too far fetched…

Maybe it’s because the PacketCollector isn’t canceled, after usage, i.e.

Nope, nextResultOrThrow cancels the packet collector.

Ok, didn’t know. I think it didn’t in Smack 3.

Np