Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory usage and calls amount increase after update #170

Open
D0L1K opened this issue Jul 19, 2022 · 1 comment
Open

Memory usage and calls amount increase after update #170

D0L1K opened this issue Jul 19, 2022 · 1 comment

Comments

@D0L1K
Copy link

D0L1K commented Jul 19, 2022

Hi,

we've updated from PHP 7.2/xDebug 2/stomp-php 4.5.1 to PHP 8.1/xDebug 3/stomp-php 5.0.0 and found out that in our case there is a 50% increase of calls and memory usage of Stomp\Network\Connection::isDataOnStream, more specifically from 267 945 calls to 379 666 calls and 79 751 040 B to 115 574 720 B. We didn't change our code at all, just PHP and composer packages.
Also I've noticed that in callers, I see that sendFrame is called from methods send, connect and disconnect in 4.5.1, however in 5.0.0 it's called only from send and connect. Not sure if this could cause some troubles?

It was profiled thru xDebug, viewed by PhpStorm. Unfortunately I have no script or a way how to provide you test data to show it to you.

Thanks for any info

@D0L1K D0L1K changed the title Memory usage increase Memory usage and calls amount increaseafter update Jul 19, 2022
@D0L1K D0L1K changed the title Memory usage and calls amount increaseafter update Memory usage and calls amount increase after update Jul 19, 2022
@whikloj
Copy link
Collaborator

whikloj commented Jun 19, 2023

Hi @D0L1K,

Looking through the changes between those two versions, there aren't many of code (mostly adding/editing tests)
4.5.1...5.0.0

It is possible that switching $this->isDataOnStream() to $this->hasDataOnStream() in Stomp\Network\Connection may have had this effect. hasDataOnStream() calls connectionHasDataToRead() which calls isDataOnStream() in a loop until it gets data or times out. 🤷

As for the client's use of sendFrame in 5.0.0, it does still appear to be the same as in 4.5.1. In case I'm just not seeing it, could you send a link to the spot you expect to see it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants