This repository has been archived by the owner on Jul 26, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Removed unrequired use of mb_ functions
These were slowing down content parsing by at least 20x, Most were checks for non-empty content, Otherwise should not be affected by not being mulit-byte managed.
- Loading branch information
1 parent
d1978c7
commit 73f41bd
Showing
3 changed files
with
42 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php namespace Ssddanbrown\HtmlDiff\Tests; | ||
|
||
use PHPUnit\Framework\TestCase; | ||
use Ssddanbrown\HtmlDiff\Diff; | ||
|
||
class HeavyContentTest extends TestCase | ||
{ | ||
|
||
public function test_large_attribute_content() | ||
{ | ||
$start = time(); | ||
$strToEncode = ''; | ||
for ($i = 0; $i < 10000; $i++) { | ||
$strToEncode .= 'cattestingstring'; | ||
} | ||
$a = '<p data-test="' . base64_encode($strToEncode) . '">contnent</p>'; | ||
$b = '<p data-test="' . base64_encode($strToEncode) . 'cat">contnent2</p>'; | ||
|
||
$output = Diff::excecute($a, $b); | ||
$this->assertNotEmpty($output); | ||
$this->assertLessThan(3, time() - $start); | ||
} | ||
|
||
} |