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

script_escape パフォーマンス改善 #955

Merged
merged 1 commit into from
Jul 4, 2024

Conversation

seasoftjapan
Copy link
Contributor

ざっくり十数倍速くなったようです。

(参考) 検証コードと結果

require_once 'modifier.script_escape.php';
$arr = [];
for ($i = 1; $i <= 1000000; $i ++) {
    $arr[] = uniqid();
}
$start = microtime(true);
foreach ($arr as $str) {
    smarty_modifier_script_escape($str);
}
echo microtime(true) - $start . PHP_EOL;
$ git restore --source=ofc/master data/smarty_extends/modifier.script_escape.php
$ php data/smarty_extends/modifier.script_escape_test.php
6.0050699710846
$ git restore --source=seasoft-script_escape data/smarty_extends/modifier.script_escape.php
$ php data/smarty_extends/modifier.script_escape_test.php
0.41585803031921

@seasoftjapan seasoftjapan added this to the 2.17.3 milestone Jul 4, 2024
@seasoftjapan seasoftjapan self-assigned this Jul 4, 2024
Copy link

codecov bot commented Jul 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 55.69%. Comparing base (4ba247b) to head (0dded83).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #955   +/-   ##
=======================================
  Coverage   55.69%   55.69%           
=======================================
  Files          75       75           
  Lines        8905     8905           
=======================================
  Hits         4960     4960           
  Misses       3945     3945           
Flag Coverage Δ
tests 55.69% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@nanasess nanasess left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@seasoftjapan seasoftjapan merged commit 202f3bd into master Jul 4, 2024
180 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants