You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Operating System version: Linux raspberrypi 4.19.97+ (On a Raspberry Pi Zero W)
Firebase SDK version: 5.2.0
Firebase Product: database
Python version: 3.7.3
Pip version: 18.1
Describe the problem
Reading a large event in response to calling Reference.listen() is extremely slow on a Raspberry Pi Zero. This looks very similar to nhorvath/Pyrebase4#45 and I noticed that the sseclient here is based on that from Pyrebase.
From reading the sseclient code, the Firebase Admin SDK seems to have solved the quadratic regex scanning issue that the sseclient in Pyrebase4 has, but it still reads the response one character at a time, which I suspect is the root issue. It looks like this is solved in https://github.com/btubbs/sseclient/blob/master/sseclient.py by reading in chunks when short reads are supported.
Steps to reproduce:
Modify the test code below to add a working databaseURL and run it. On my Raspberry Pi Zero W, it outputs:
0 ms: Initializing app...
1 ms: Getting DB reference...
17 ms: Putting 20000 bytes...
1122 ms: Getting data...
1347 ms: Got 20000 bytes with get().
1349 ms: Listening for data...
11686 ms: Got 20000 bytes with listen().
That is, listen() takes about 10 000 ms (with close to 100% CPU usage) to get and read the response, while get() takes 200 ms.
Describe your environment
Describe the problem
Reading a large event in response to calling Reference.listen() is extremely slow on a Raspberry Pi Zero. This looks very similar to nhorvath/Pyrebase4#45 and I noticed that the sseclient here is based on that from Pyrebase.
From reading the sseclient code, the Firebase Admin SDK seems to have solved the quadratic regex scanning issue that the sseclient in Pyrebase4 has, but it still reads the response one character at a time, which I suspect is the root issue. It looks like this is solved in https://github.com/btubbs/sseclient/blob/master/sseclient.py by reading in chunks when short reads are supported.
Steps to reproduce:
Modify the test code below to add a working databaseURL and run it. On my Raspberry Pi Zero W, it outputs:
That is, listen() takes about 10 000 ms (with close to 100% CPU usage) to get and read the response, while get() takes 200 ms.
Relevant Code:
The text was updated successfully, but these errors were encountered: