Skip to content
This repository was archived by the owner on Jan 31, 2020. It is now read-only.

Fixed FastPriorityQueue index and added the remove() function #22

Merged
merged 1 commit into from
Sep 21, 2015

Conversation

ezimuel
Copy link
Contributor

@ezimuel ezimuel commented Sep 21, 2015

This PR fixes an issue with the internal index of the FastPriorityQueue and add the remove() function. This function acts like the remove method of the Zend\Stdlib\PriorityQueue but the performance are much faster (see benchmark below).

Moreover, I divided the benchmarks into separate files and I added the remove test. Here is reported a test using an Intel Core i5-2500 at 3.30GHz with 8 Gb of RAM running Ubuntu Linux 14.04 and PHP 5.5.9:

ZendBench\Stdlib\ExtractPriorityQueue
    Method Name                Iterations    Average Time      Ops/second
    ------------------------  ------------  --------------    -------------
    extractSplPriorityQueue : [5,000     ] [0.0000028611183] [349,513.68288]
    extractPriorityQueue    : [5,000     ] [0.0000032114506] [311,385.76668]
    extractFastPriorityQueue: [5,000     ] [0.0000013429165] [744,647.94234]


ZendBench\Stdlib\InsertPriorityQueue
    Method Name               Iterations    Average Time      Ops/second
    -----------------------  ------------  --------------    -------------
    insertSplPriorityQueue : [5,000     ] [0.0000019140244] [522,459.39213]
    insertPriorityQueue    : [5,000     ] [0.0000052907467] [189,009.23798]
    insertFastPriorityQueue: [5,000     ] [0.0000008188248] [1,221,262.52038]


ZendBench\Stdlib\RemovePriorityQueue
    Method Name               Iterations    Average Time      Ops/second
    -----------------------  ------------  --------------    -------------
    removePriorityQueue    : [1,000     ] [0.0008117966652] [1,231.83556]
    removeFastPriorityQueue: [1,000     ] [0.0000023496151] [425,601.62354]

@weierophinney weierophinney added this to the 3.0.0 milestone Sep 21, 2015
@weierophinney weierophinney self-assigned this Sep 21, 2015
@weierophinney weierophinney merged commit cdb586b into zendframework:develop Sep 21, 2015
weierophinney added a commit that referenced this pull request Sep 21, 2015
Fixed FastPriorityQueue index and added the remove() function
weierophinney added a commit that referenced this pull request Sep 21, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants