{"action":"created","issue":{"url":"https://api.github.com/repos/u01jmg3/ics-parser/issues/184","repository_url":"https://api.github.com/repos/u01jmg3/ics-parser","labels_url":"https://api.github.com/repos/u01jmg3/ics-parser/issues/184/labels{/name}","comments_url":"https://api.github.com/repos/u01jmg3/ics-parser/issues/184/comments","events_url":"https://api.github.com/repos/u01jmg3/ics-parser/issues/184/events","html_url":"https://github.com/u01jmg3/ics-parser/issues/184","id":361846045,"node_id":"MDU6SXNzdWUzNjE4NDYwNDU=","number":184,"title":"(Overly?) Slow parsing","user":{"login":"marcelstoer","id":624195,"node_id":"MDQ6VXNlcjYyNDE5NQ==","avatar_url":"https://avatars0.githubusercontent.com/u/624195?v=4","gravatar_id":"","url":"https://api.github.com/users/marcelstoer","html_url":"https://github.com/marcelstoer","followers_url":"https://api.github.com/users/marcelstoer/followers","following_url":"https://api.github.com/users/marcelstoer/following{/other_user}","gists_url":"https://api.github.com/users/marcelstoer/gists{/gist_id}","starred_url":"https://api.github.com/users/marcelstoer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marcelstoer/subscriptions","organizations_url":"https://api.github.com/users/marcelstoer/orgs","repos_url":"https://api.github.com/users/marcelstoer/repos","events_url":"https://api.github.com/users/marcelstoer/events{/privacy}","received_events_url":"https://api.github.com/users/marcelstoer/received_events","type":"User","site_admin":false},"labels":[{"id":202532170,"node_id":"MDU6TGFiZWwyMDI1MzIxNzA=","url":"https://api.github.com/repos/u01jmg3/ics-parser/labels/awaiting-feedback","name":"awaiting-feedback","color":"207de5","default":false}],"state":"open","locked":false,"assignee":{"login":"u01jmg3","id":1266205,"node_id":"MDQ6VXNlcjEyNjYyMDU=","avatar_url":"https://avatars2.githubusercontent.com/u/1266205?v=4","gravatar_id":"","url":"https://api.github.com/users/u01jmg3","html_url":"https://github.com/u01jmg3","followers_url":"https://api.github.com/users/u01jmg3/followers","following_url":"https://api.github.com/users/u01jmg3/following{/other_user}","gists_url":"https://api.github.com/users/u01jmg3/gists{/gist_id}","starred_url":"https://api.github.com/users/u01jmg3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/u01jmg3/subscriptions","organizations_url":"https://api.github.com/users/u01jmg3/orgs","repos_url":"https://api.github.com/users/u01jmg3/repos","events_url":"https://api.github.com/users/u01jmg3/events{/privacy}","received_events_url":"https://api.github.com/users/u01jmg3/received_events","type":"User","site_admin":false},"assignees":[{"login":"u01jmg3","id":1266205,"node_id":"MDQ6VXNlcjEyNjYyMDU=","avatar_url":"https://avatars2.githubusercontent.com/u/1266205?v=4","gravatar_id":"","url":"https://api.github.com/users/u01jmg3","html_url":"https://github.com/u01jmg3","followers_url":"https://api.github.com/users/u01jmg3/followers","following_url":"https://api.github.com/users/u01jmg3/following{/other_user}","gists_url":"https://api.github.com/users/u01jmg3/gists{/gist_id}","starred_url":"https://api.github.com/users/u01jmg3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/u01jmg3/subscriptions","organizations_url":"https://api.github.com/users/u01jmg3/orgs","repos_url":"https://api.github.com/users/u01jmg3/repos","events_url":"https://api.github.com/users/u01jmg3/events{/privacy}","received_events_url":"https://api.github.com/users/u01jmg3/received_events","type":"User","site_admin":false}],"milestone":null,"comments":9,"created_at":"2018-09-19T17:16:02Z","updated_at":"2018-09-21T17:57:27Z","closed_at":null,"author_association":"NONE","body":"- PHP Version: `7.1.16`\r\n- PHP date.timezone: `UTC`\r\n- ICS Parser Version: `2.1.5`\r\n- ~~Windows~~/Mac/Linux\r\n\r\n### Description of the Issue:\r\nParsing the attached [exchange.ics.txt](https://github.com/u01jmg3/ics-parser/files/2398038/exchange.ics.txt) takes some 3s. For my use case this is way too slow but I have no idea if this is considered \"normal\" with this library. Before I download & configure `Xdebug` (PHP is not my home turf) to see where those milliseconds are lost I would like to know how you assess this case.\r\n\r\nFile size: 160KB\r\nNumber of events: 242\r\nWhen expanded with span 1: 512\r\n\r\n### Steps to Reproduce:\r\n```php\r\n<?php\r\ndate_default_timezone_set(\"UTC\");\r\nrequire_once \"./vendor/autoload.php\";\r\n\r\nuse ICal\\ICal;\r\n\r\n$calendarString = \"\";\r\n\r\ntry {\r\n    $ical = new ICal(array(\r\n        \"defaultSpan\"                 => 1,     // Default value: 2\r\n        \"defaultWeekStart\"            => \"MO\",  // Default value\r\n        \"disableCharacterReplacement\" => false, // Default value\r\n        \"skipRecurrence\"              => false, // Default value\r\n        \"useTimeZoneWithRRules\"       => false, // Default value\r\n    ));\r\n    $millis = getMillis();\r\n    $ical->initString($calendarString);\r\n    echo \"ical->initString() took \" . (getMillis() - $millis) . \"ms\\n\";\r\n    $events = $ical->events();\r\n    echo \"calendar contains \" . sizeof($events) . \" events (recurring span: 1y)\\n\";\r\n} catch (\\Exception $e) {\r\n    die($e);\r\n}\r\nfunction getMillis() {\r\n    return round(microtime(true) * 1000);\r\n}\r\n```\r\n\r\nI pasted the content of the file [exchange.ics.txt](https://github.com/u01jmg3/ics-parser/files/2398038/exchange.ics.txt) into `$calendarString`."},"comment":{"url":"https://api.github.com/repos/u01jmg3/ics-parser/issues/comments/423621846","html_url":"https://github.com/u01jmg3/ics-parser/issues/184#issuecomment-423621846","issue_url":"https://api.github.com/repos/u01jmg3/ics-parser/issues/184","id":423621846,"node_id":"MDEyOklzc3VlQ29tbWVudDQyMzYyMTg0Ng==","user":{"login":"marcelstoer","id":624195,"node_id":"MDQ6VXNlcjYyNDE5NQ==","avatar_url":"https://avatars0.githubusercontent.com/u/624195?v=4","gravatar_id":"","url":"https://api.github.com/users/marcelstoer","html_url":"https://github.com/marcelstoer","followers_url":"https://api.github.com/users/marcelstoer/followers","following_url":"https://api.github.com/users/marcelstoer/following{/other_user}","gists_url":"https://api.github.com/users/marcelstoer/gists{/gist_id}","starred_url":"https://api.github.com/users/marcelstoer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marcelstoer/subscriptions","organizations_url":"https://api.github.com/users/marcelstoer/orgs","repos_url":"https://api.github.com/users/marcelstoer/repos","events_url":"https://api.github.com/users/marcelstoer/events{/privacy}","received_events_url":"https://api.github.com/users/marcelstoer/received_events","type":"User","site_admin":false},"created_at":"2018-09-21T17:57:27Z","updated_at":"2018-09-21T17:57:27Z","author_association":"NONE","body":"> I am surprised it had little affect as `mb_str_replace()` had the highest cost in your report and won't run if `disableCharacterReplacement=true`.\r\n\r\nFirst finding: `cleanData()` is always executed regardless of whether I set `true` or `false` in the constructor, at https://github.com/u01jmg3/ics-parser/blob/master/src/ICal/ICal.php#L328 it's always `true`.\r\nWhy? Because the constructor has defaults for both parameters and because I missed to understand that.\r\n\r\nI took your example at https://github.com/u01jmg3/ics-parser/blob/master/examples/index.php#L9 and _removed the first parameter_ (see my code above). It runs just fine but the effect is that `$options` at https://github.com/u01jmg3/ics-parser/blob/master/src/ICal/ICal.php#L234 is not _my_ options but the default empty array 😞 \r\n\r\nMore to come..."}}
{"actor":{"display_login":"marcelstoer"}}