Skip to content

It would be great to have some numbers for array lookup performance. #4

Description

@doug65536

It would be great to have some timings for lookups on empty, small (16 entry), medium sized (perhaps 64 entry), large (perhaps 1000 entry), very large (perhaps 50,000 entry), and huge (500,000 entry) arrays. By array I mean this type: array('foo' => 123, 'bar' => 345).

Insertion, and unset timings would be terrific to see as well.

It would also be very enlightening to see whether integer keys are significantly faster than string keys.

I have always assumed that php's associative arrays would be fast, but it has been a curiosity of mine for a while just how fast. Maybe they're not fast! Maybe they suck! But probably not. Having numbers you generated alongside the existing stuff you test would be excellent.

Are they red black trees? Are they vectors that are binary searched (causing awful insertion performance, but amazing iteration performance)? Are they a vector of values with a hash table "key index"? Does array_splice renumbering of indices kill performance? Are they linear searched (doubtful). Knowing lookup and insertion numbers would make it possible to determine what's behind it.

Thanks!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions