We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
From @rdlowrey via IRC:
Using str_pad instead of looping over the payload to mask/de-mask should yield a performance gain:
$payload = $payload ^ str_pad('', $length, $mask, STR_PAD_RIGHT);
The text was updated successfully, but these errors were encountered:
Frame masking perf
ce50c6c
refs ratchetphp/Ratchet#226
You should try str_repeat I made some benchmark spec with various method and it's happen to be the fastest. The samplesize I use is 1000000.
$effectiveMask = str_repeat($this->mask , ($samplesize/4)+1 ); $over=$samplesize-strlen($effectiveMask); $effectiveMask=substr($effectiveMask,0,$samplesize);
Sorry, something went wrong.
No branches or pull requests
From @rdlowrey via IRC:
Using str_pad instead of looping over the payload to mask/de-mask should yield a performance gain:
The text was updated successfully, but these errors were encountered: