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
This is no problem for caching scenario's, but the Stream storage adapter may as well be used for permanent storage.
To Reproduce
This is not easy to reproduce with just a simple script, you need to run a lot of writing / reading of Streams over some time. Then exceptions will appear.
Expected behavior
Not have random errors when reading stream data with the Json adapter.
Of course this is easily fixed by simply using if instead of if unlikely, but this probably more a design philosophy question.
Details
Phalcon version: 4.2 (But still present in 5.x)
PHP Version: 7.4
Operating System: Linux
Installation type: Cloudlinux
Server: Apache
The text was updated successfully, but these errors were encountered:
Describe the bug
The Json serialiser uses
if unlikely
when determining if json_decode gives an error or not. This is faster, but can give unexpected results. https://igoro.com/archive/fast-and-slow-if-statements-branch-prediction-in-modern-processors/.This is no problem for caching scenario's, but the Stream storage adapter may as well be used for permanent storage.
To Reproduce
This is not easy to reproduce with just a simple script, you need to run a lot of writing / reading of Streams over some time. Then exceptions will appear.
Expected behavior
Not have random errors when reading stream data with the Json adapter.
Of course this is easily fixed by simply using
if
instead ofif unlikely
, but this probably more a design philosophy question.Details
The text was updated successfully, but these errors were encountered: