Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update benchmark to include T::H::I OO interface #11

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mhx
Copy link

@mhx mhx commented Nov 14, 2020

I found the benchmark to be really useful, thanks for taking the time to create this!

It didn't cover the OO interface of Tie::Hash::Indexed yet, which is (at least from the perspective of the benchmark) identical to that of Hash::Ordered, so it was easy to add this to the benchmark as well.

Here are the results I've got. I've added a marker for Tie::Hash::Indexed results as well, but feel free to remove it from the PR if you think it's distracting.

    Results for ordered hash creation for 10 elements
            t:h:i_oo   245059/s  ~
            t:h:i_th   231805/s  ~
              h:o_oo   155149/s  *
              h:o_th   147821/s  *
             a:ah_rf   140438/s
             a:ah_cp    86075/s
             t:ix_th    78767/s
             t:ix_oo    78194/s
                a:oh    62183/s
               t:llh    38937/s
             d:xh_ls    16940/s
             d:xh_rf    16841/s

    Results for ordered hash creation for 100 elements
            t:h:i_th    26295/s  ~
            t:h:i_oo    22713/s  ~
             a:ah_rf    17438/s
              h:o_oo    15340/s  *
              h:o_th    15283/s  *
             t:ix_th     8751/s
             t:ix_oo     8726/s
             a:ah_cp     8703/s
                a:oh     8062/s
               t:llh     4093/s
             d:xh_ls     1775/s
             d:xh_rf     1766/s

    Results for ordered hash creation for 1000 elements
            t:h:i_oo     1714/s  ~
             a:ah_rf     1697/s
            t:h:i_th     1688/s  ~
              h:o_oo     1397/s  *
              h:o_th     1386/s  *
             a:ah_cp      872/s
             t:ix_th      840/s
             t:ix_oo      840/s
                a:oh      770/s
               t:llh      367/s
             d:xh_ls      171/s
             d:xh_rf      170/s

    Results for fetching ~10% of 10 elements
            t:h:i_oo  3862506/s  ~
              h:o_oo  3032824/s  *
             t:ix_oo  1784826/s
             d:xh_oo  1611188/s
            t:h:i_th  1359311/s  ~
              h:o_th  1221952/s  *
             t:ix_th   941963/s
             d:xh_rf   885816/s
                a:oh   789178/s
               t:llh   682737/s
                a:ah   287636/s

    Results for fetching ~10% of 100 elements
            t:h:i_oo   514053/s  ~
              h:o_oo   367265/s  *
             t:ix_oo   200196/s
             d:xh_oo   180022/s
            t:h:i_th   144807/s  ~
              h:o_th   129830/s  *
             t:ix_th    99553/s
             d:xh_rf    91815/s
                a:oh    80990/s
               t:llh    71183/s
                a:ah    28980/s

    Results for fetching ~10% of 1000 elements
            t:h:i_oo    49494/s  ~
              h:o_oo    36182/s  *
             t:ix_oo    19610/s
             d:xh_oo    18130/s
            t:h:i_th    14518/s  ~
              h:o_th    13122/s  *
             t:ix_th     9822/s
             d:xh_rf     9488/s
                a:oh     8216/s
               t:llh     7028/s
                a:ah     2916/s

    Results for replacing ~10% of 10 elements
            t:h:i_oo  4758053/s  ~
              h:o_oo  2155712/s  *
            t:h:i_th  1379829/s  ~
             t:ix_oo  1251139/s
             d:xh_oo  1133083/s
              h:o_th   906767/s  *
               t:llh   830239/s
                a:oh   700467/s
             d:xh_rf   689913/s
             t:ix_th   685514/s
                a:ah   183210/s

    Results for replacing ~10% of 100 elements
            t:h:i_oo   606373/s  ~
              h:o_oo   245752/s  *
            t:h:i_th   147539/s  ~
             t:ix_oo   138371/s
             d:xh_oo   122529/s
              h:o_th    95284/s  *
               t:llh    86718/s
                a:oh    73382/s
             t:ix_th    72265/s
             d:xh_rf    72012/s
                a:ah    18718/s

    Results for replacing ~10% of 1000 elements
            t:h:i_oo    60686/s  ~
              h:o_oo    24515/s  *
            t:h:i_th    14711/s  ~
             t:ix_oo    13754/s
             d:xh_oo    12395/s
              h:o_th     9579/s  *
               t:llh     8644/s
                a:oh     7391/s
             t:ix_th     7206/s
             d:xh_rf     7123/s
                a:ah     1867/s

    Results for adding 10 elements to empty hash
            t:h:i_oo   600365/s  ~
            t:h:i_th   430079/s  ~
              h:o_oo   397957/s  *
             t:ix_oo   323354/s
              h:o_th   295642/s  *
             t:ix_th   261673/s
               t:llh   225408/s
                a:oh   178029/s
                a:ah   132486/s
             d:xh_oo   107211/s
             d:xh_rf    98088/s

    Results for adding 100 elements to empty hash
            t:h:i_oo   100596/s  ~
            t:h:i_th    70218/s  ~
              h:o_oo    67632/s  *
             t:ix_oo    59189/s
              h:o_th    46172/s  *
             t:ix_th    44155/s
                a:oh    40649/s
               t:llh    32746/s
             d:xh_oo    28607/s
             d:xh_rf    24251/s
                a:ah    15954/s

    Results for adding 1000 elements to empty hash
            t:h:i_oo     9842/s  ~
              h:o_oo     6928/s  *
            t:h:i_th     6853/s  ~
             t:ix_oo     6279/s
              h:o_th     4678/s  *
                a:oh     4583/s
             t:ix_th     4583/s
             d:xh_oo     3317/s
               t:llh     3299/s
             d:xh_rf     2749/s
                a:ah     1621/s

    Results for creating 10 element hash then deleting ~10%
            t:h:i_oo   239572/s  ~
            t:h:i_th   205984/s  ~
              h:o_oo   127000/s  *
              h:o_th   113657/s  *
                a:ah    73769/s
             t:ix_oo    65214/s
             t:ix_th    60801/s
                a:oh    55119/s
               t:llh    35274/s
             d:xh_oo    15514/s
             d:xh_rf    15340/s

    Results for creating 100 element hash then deleting ~10%
            t:h:i_oo    25795/s  ~
            t:h:i_th    22080/s  ~
              h:o_oo    11335/s  *
              h:o_th    10181/s  *
             t:ix_oo     5716/s
             t:ix_th     5367/s
                a:oh     5327/s
               t:llh     3566/s
                a:ah     3368/s
             d:xh_oo     1596/s
             d:xh_rf     1573/s

    Results for creating 1000 element hash then deleting ~10%
            t:h:i_oo     1956/s  ~
            t:h:i_th     1772/s  ~
              h:o_oo     1012/s  *
              h:o_th      937/s  *
               t:llh      344/s
                a:oh      195/s
             d:xh_oo      158/s
             d:xh_rf      157/s
             t:ix_oo      100/s
             t:ix_th       98/s
                a:ah       37/s

    Results for listing pairs of 10 element hash
                a:ah   683343/s
            t:h:i_oo   571261/s  ~
              h:o_oo   264976/s  *
             t:ix_oo   113994/s
            t:h:i_th    91895/s  ~
              h:o_th    63481/s  *
                a:oh    62899/s
             t:ix_th    56034/s
                d:xh    46231/s
               t:llh    44073/s

    Results for listing pairs of 100 element hash
                a:ah    85687/s
            t:h:i_oo    63621/s  ~
              h:o_oo    30228/s  *
             t:ix_oo    11752/s
            t:h:i_th     8930/s  ~
              h:o_th     6989/s  *
                a:oh     6350/s
             t:ix_th     5633/s
                d:xh     4809/s
               t:llh     4250/s

    Results for listing pairs of 1000 element hash
                a:ah     7642/s
            t:h:i_oo     5317/s  ~
              h:o_oo     2543/s  *
             t:ix_oo     1066/s
            t:h:i_th      823/s  ~
              h:o_th      635/s  *
                a:oh      600/s
             t:ix_th      547/s
                d:xh      489/s
               t:llh      401/s

@coveralls
Copy link

Coverage Status

Coverage remained the same at 98.077% when pulling 0d17a23 on mhx:update-benchmark into c703c0e on dagolden:master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants