|
Mantis - Quercus
|
|||||
| Viewing Issue Advanced Details | |||||
|
|
|||||
| ID: | Category: | Severity: | Reproducibility: | Date Submitted: | Last Update: |
| 3195 | major | always | 12-24-08 21:52 | 12-27-08 15:40 | |
|
|
|||||
| Reporter: | koreth | Platform: | |||
| Assigned To: | ferg | OS: | |||
| Priority: | normal | OS Version: | |||
| Status: | closed | Product Version: | 4.0.0 | ||
| Product Build: | Resolution: | fixed | |||
| Projection: | none | ||||
| ETA: | none | Fixed in Version: | 4.0.0 | ||
|
|
|||||
| Summary: | 0003195: Anchored regexes take time proportional to subject string size | ||||
| Description: |
<?php $sizes = array(1000, 10000, 100000, 1000000, 10000000); foreach ($sizes as $size) { $str = str_repeat('abcde', $size); $start_time = microtime(true); $match = preg_match('/x/A', $str); $end_time = microtime(true); printf("size %d took %0.6fsec \n", $size, $end_time - $start_time); } In regular PHP, each run takes more or less the same amount of time. In Quercus, each run takes longer than the last by a factor of 10. The behavior is also there if you use /^x/ instead of /x/A to anchor the regex. This is making some of our on-the-fly JavaScript rewriting run so slowly the scripts time out. |
||||
| Steps To Reproduce: | |||||
| Additional Information: | |||||
| Relationships | |||||
| Attached Files: | |||||
| Notes | |||||
|
|
|||||
|
|
||||
|
|
|||||
|
|
||||