{"action":"created","issue":{"url":"https://api.github.com/repos/zendframework/zend-eventmanager/issues/17","labels_url":"https://api.github.com/repos/zendframework/zend-eventmanager/issues/17/labels{/name}","comments_url":"https://api.github.com/repos/zendframework/zend-eventmanager/issues/17/comments","events_url":"https://api.github.com/repos/zendframework/zend-eventmanager/issues/17/events","html_url":"https://github.com/zendframework/zend-eventmanager/pull/17","id":120594948,"number":17,"title":"Performance increasement by integer priority","user":{"login":"marc-mabe","id":302689,"avatar_url":"https://avatars.githubusercontent.com/u/302689?v=3","gravatar_id":"","url":"https://api.github.com/users/marc-mabe","html_url":"https://github.com/marc-mabe","followers_url":"https://api.github.com/users/marc-mabe/followers","following_url":"https://api.github.com/users/marc-mabe/following{/other_user}","gists_url":"https://api.github.com/users/marc-mabe/gists{/gist_id}","starred_url":"https://api.github.com/users/marc-mabe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marc-mabe/subscriptions","organizations_url":"https://api.github.com/users/marc-mabe/orgs","repos_url":"https://api.github.com/users/marc-mabe/repos","events_url":"https://api.github.com/users/marc-mabe/events{/privacy}","received_events_url":"https://api.github.com/users/marc-mabe/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-12-05T23:15:37Z","updated_at":"2015-12-08T20:45:08Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/zendframework/zend-eventmanager/pulls/17","html_url":"https://github.com/zendframework/zend-eventmanager/pull/17","diff_url":"https://github.com/zendframework/zend-eventmanager/pull/17.diff","patch_url":"https://github.com/zendframework/zend-eventmanager/pull/17.patch"},"body":"After my PR #16 I experimented with integer priorities.\r\n\r\nIt's no longer storing priorities as string with `.0` suffix but store as integer. This makes it harder to merge listeners of the same priority by name, wildcard or shared but in the end I sow a very good performance improvement, only `MultipleEventMultipleSharedListener` decreases a little (see below).\r\n\r\nAll tests passed for me but it should be tested carefully anyway ;)\r\n\r\n# PHP 5.6\r\nPHP 5.6.14-0+deb8u1 (cli) (built: Oct  4 2015 16:13:10) \r\nCopyright (c) 1997-2015 The PHP Group\r\nZend Engine v2.6.0, Copyright (c) 1998-2015 Zend Technologies\r\n    with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2015, by Zend Technologies\r\n\r\n## Branch: develop\r\n```\r\nZendBench\\EventManager\\MultipleEventIndividualSharedListener\r\n    Method Name   Iterations    Average Time      Ops/second\r\n    -------  ------------  --------------    -------------\r\n    trigger: [5,000     ] [0.0000237437248] [42,116.39107]\r\n\r\n\r\nZendBench\\EventManager\\MultipleEventLocalListener\r\n    Method Name   Iterations    Average Time      Ops/second\r\n    -------  ------------  --------------    -------------\r\n    trigger: [5,000     ] [0.0000196894646] [50,788.58272]\r\n\r\n\r\nZendBench\\EventManager\\MultipleEventMultipleLocalAndSharedListener\r\n    Method Name   Iterations    Average Time      Ops/second\r\n    -------  ------------  --------------    -------------\r\n    trigger: [5,000     ] [0.0002710880280] [3,688.83867]\r\n\r\n\r\nZendBench\\EventManager\\MultipleEventMultipleSharedListener\r\n    Method Name   Iterations    Average Time      Ops/second\r\n    -------  ------------  --------------    -------------\r\n    trigger: [5,000     ] [0.0000575615883] [17,372.69644]\r\n\r\n\r\nZendBench\\EventManager\\SingleEventMultipleListener\r\n    Method Name   Iterations    Average Time      Ops/second\r\n    -------  ------------  --------------    -------------\r\n    trigger: [5,000     ] [0.0000446063042] [22,418.35585]\r\n\r\n\r\nZendBench\\EventManager\\SingleEventMultipleSharedListener\r\n    Method Name   Iterations    Average Time      Ops/second\r\n    -------  ------------  --------------    -------------\r\n    trigger: [5,000     ] [0.0000478469849] [20,899.95854]\r\n\r\n\r\nZendBench\\EventManager\\SingleEventSingleListener\r\n    Method Name   Iterations    Average Time      Ops/second\r\n    -------  ------------  --------------    -------------\r\n    trigger: [5,000     ] [0.0000078002930] [128,200.31299]\r\n\r\n\r\nZendBench\\EventManager\\SingleEventSingleSharedListener\r\n    Method Name   Iterations    Average Time      Ops/second\r\n    -------  ------------  --------------    -------------\r\n    trigger: [5,000     ] [0.0000106687546] [93,731.65281]\r\n```\r\n\r\n## Branch: integer_priority\r\n```\r\nZendBench\\EventManager\\MultipleEventIndividualSharedListener\r\n    Method Name   Iterations    Average Time      Ops/second\r\n    -------  ------------  --------------    -------------\r\n    trigger: [5,000     ] [0.0000230637074] [43,358.16375]\r\n\r\n\r\nZendBench\\EventManager\\MultipleEventLocalListener\r\n    Method Name   Iterations    Average Time      Ops/second\r\n    -------  ------------  --------------    -------------\r\n    trigger: [5,000     ] [0.0000166062355] [60,218.34387]\r\n\r\n\r\nZendBench\\EventManager\\MultipleEventMultipleLocalAndSharedListener\r\n    Method Name   Iterations    Average Time      Ops/second\r\n    -------  ------------  --------------    -------------\r\n    trigger: [5,000     ] [0.0002452962399] [4,076.70334]\r\n\r\n\r\nZendBench\\EventManager\\MultipleEventMultipleSharedListener\r\n    Method Name   Iterations    Average Time      Ops/second\r\n    -------  ------------  --------------    -------------\r\n    trigger: [5,000     ] [0.0000640497684] [15,612.85894]\r\n\r\n\r\nZendBench\\EventManager\\SingleEventMultipleListener\r\n    Method Name   Iterations    Average Time      Ops/second\r\n    -------  ------------  --------------    -------------\r\n    trigger: [5,000     ] [0.0000399168015] [25,052.10747]\r\n\r\n\r\nZendBench\\EventManager\\SingleEventMultipleSharedListener\r\n    Method Name   Iterations    Average Time      Ops/second\r\n    -------  ------------  --------------    -------------\r\n    trigger: [5,000     ] [0.0000434321880] [23,024.39838]\r\n\r\n\r\nZendBench\\EventManager\\SingleEventSingleListener\r\n    Method Name   Iterations    Average Time      Ops/second\r\n    -------  ------------  --------------    -------------\r\n    trigger: [5,000     ] [0.0000066055775] [151,387.21856]\r\n\r\n\r\nZendBench\\EventManager\\SingleEventSingleSharedListener\r\n    Method Name   Iterations    Average Time      Ops/second\r\n    -------  ------------  --------------    -------------\r\n    trigger: [5,000     ] [0.0000096778870] [103,328.34056]\r\n```\r\n\r\n# PHP 7.0\r\nPHP 7.0.0 (cli) (built: Dec  5 2015 23:50:11) ( NTS )\r\nCopyright (c) 1997-2015 The PHP Group\r\nZend Engine v3.0.0, Copyright (c) 1998-2015 Zend Technologies\r\n\r\n```\r\nFatal error: Uncaught TypeError: Argument 1 passed to Athletic\\Common\\CmdLineErrorHandler::handleException() must be an instance of Exception, instance of Error given in /home/mabe/workspace/zend-eventmanager/vendor/athletic/athletic/src/Athletic/Common/CmdLineErrorHandler.php:35\r\nStack trace:\r\n#0 [internal function]: Athletic\\Common\\CmdLineErrorHandler->handleException(Object(Error))\r\n#1 {main}\r\n  thrown in /home/mabe/workspace/zend-eventmanager/vendor/athletic/athletic/src/Athletic/Common/CmdLineErrorHandler.php on line 35\r\n```\r\n\r\nSomething with athletic doesn't work with PHP-7 but I have no time to figure that out.\r\n"},"comment":{"url":"https://api.github.com/repos/zendframework/zend-eventmanager/issues/comments/163012796","html_url":"https://github.com/zendframework/zend-eventmanager/pull/17#issuecomment-163012796","issue_url":"https://api.github.com/repos/zendframework/zend-eventmanager/issues/17","id":163012796,"user":{"login":"marc-mabe","id":302689,"avatar_url":"https://avatars.githubusercontent.com/u/302689?v=3","gravatar_id":"","url":"https://api.github.com/users/marc-mabe","html_url":"https://github.com/marc-mabe","followers_url":"https://api.github.com/users/marc-mabe/followers","following_url":"https://api.github.com/users/marc-mabe/following{/other_user}","gists_url":"https://api.github.com/users/marc-mabe/gists{/gist_id}","starred_url":"https://api.github.com/users/marc-mabe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marc-mabe/subscriptions","organizations_url":"https://api.github.com/users/marc-mabe/orgs","repos_url":"https://api.github.com/users/marc-mabe/repos","events_url":"https://api.github.com/users/marc-mabe/events{/privacy}","received_events_url":"https://api.github.com/users/marc-mabe/received_events","type":"User","site_admin":false},"created_at":"2015-12-08T20:45:08Z","updated_at":"2015-12-08T20:45:08Z","body":"Yes it is but only for wildcard and shared events if there are already events attached with the same priority."}}