voku/anti-xss

performance investigation

Closed this issue · 2 comments

What is this feature about (expected vs actual behaviour)?

we are using the lib and realized that adding single call of code like

https://github.com/redaxo/redaxo/blob/0ac764c3a60b75e8f6bd9d6d8b96d60d9d29a321/redaxo/src/core/lib/util/string.php#L212-L226

aleady adds a major performance hit to our cms.

we are in the process of discussing a one-line PR redaxo/redaxo#4070 which might not land because of bad performance.

How can I reproduce it?

I guess its too complicated to describe the repro.
I can reproduce it locally though. its something like

  • download and install the redaxo cms
  • login into the redaxo backend
  • import the demo
  • try to delete a module, which is still in use
  • copy the ajax request from the browser dev tools as a CLI CURL command
  • run blackfire with the extracted curl command

Does it take minutes, hours or days to fix?

don't know

Any additional information?

see the blackfire profile https://blackfire.io/profiles/436c75ee-07d7-4931-ba57-c720f8fa234f/graph (note: I guess this link will be invalid within 30 days)

repeated calls to strpos seem to be the culprit right now:

grafik

Issue Label Bot is not confident enough to auto-label this issue. See dashboard for more details.

voku commented

Can you check if the new version fixes your problem, thanks. :)