| | 1 | Current XPath implementation is in most cases faster than previous one: |
| | 2 | |
| | 3 | == Previous XPath implementation == |
| | 4 | {{{ |
| | 5 | Testing self path |
| | 6 | Running on "small document" example: |
| | 7 | Just select: 76.293945 microseconds |
| | 8 | __init__ + select: 112.304688 microseconds |
| | 9 | Running on "big document" example: |
| | 10 | Just select: 207.519531 microseconds |
| | 11 | __init__ + select: 244.140625 microseconds |
| | 12 | Testing quite long path |
| | 13 | Running on "small document" example: |
| | 14 | Just select: 104.980469 microseconds |
| | 15 | __init__ + select: 213.623047 microseconds |
| | 16 | Running on "big document" example: |
| | 17 | Just select: 334.472656 microseconds |
| | 18 | __init__ + select: 444.335938 microseconds |
| | 19 | Testing quite long + parameter path |
| | 20 | Running on "small document" example: |
| | 21 | Just select: 104.370117 microseconds |
| | 22 | __init__ + select: 231.933594 microseconds |
| | 23 | Running on "big document" example: |
| | 24 | Just select: 334.472656 microseconds |
| | 25 | __init__ + select: 480.957031 microseconds |
| | 26 | Testing complicated path |
| | 27 | Running on "small document" example: |
| | 28 | Just select: 107.421875 microseconds |
| | 29 | __init__ + select: 351.562500 microseconds |
| | 30 | Running on "big document" example: |
| | 31 | Just select: 334.472656 microseconds |
| | 32 | __init__ + select: 576.171875 microseconds |
| | 33 | Testing all text path |
| | 34 | Running on "small document" example: |
| | 35 | Just select: 98.266602 microseconds |
| | 36 | __init__ + select: 152.587891 microseconds |
| | 37 | Running on "big document" example: |
| | 38 | Just select: 305.175781 microseconds |
| | 39 | __init__ + select: 361.328125 microseconds |
| | 40 | Testing tag text path |
| | 41 | Running on "small document" example: |
| | 42 | Just select: 104.980469 microseconds |
| | 43 | __init__ + select: 183.105469 microseconds |
| | 44 | Running on "big document" example: |
| | 45 | Just select: 312.500000 microseconds |
| | 46 | __init__ + select: 390.625000 microseconds |
| | 47 | }}} |
| | 48 | |
| | 49 | == Current XPath implementation == |
| | 50 | {{{ |
| | 51 | Testing self path |
| | 52 | Running on "small document" example: |
| | 53 | Just select: 72.631836 microseconds |
| | 54 | __init__ + select: 111.694336 microseconds |
| | 55 | Running on "big document" example: |
| | 56 | Just select: 216.064453 microseconds |
| | 57 | __init__ + select: 258.789063 microseconds |
| | 58 | Testing quite long path |
| | 59 | Running on "small document" example: |
| | 60 | Just select: 64.697266 microseconds |
| | 61 | __init__ + select: 194.091797 microseconds |
| | 62 | Running on "big document" example: |
| | 63 | Just select: 163.574219 microseconds |
| | 64 | __init__ + select: 290.527344 microseconds |
| | 65 | Testing quite long + parameter path |
| | 66 | Running on "small document" example: |
| | 67 | Just select: 64.697266 microseconds |
| | 68 | __init__ + select: 211.181641 microseconds |
| | 69 | Running on "big document" example: |
| | 70 | Just select: 162.353516 microseconds |
| | 71 | __init__ + select: 312.500000 microseconds |
| | 72 | Testing complicated path |
| | 73 | Running on "small document" example: |
| | 74 | Just select: 106.811523 microseconds |
| | 75 | __init__ + select: 361.328125 microseconds |
| | 76 | Running on "big document" example: |
| | 77 | Just select: 278.320313 microseconds |
| | 78 | __init__ + select: 527.343750 microseconds |
| | 79 | Testing all text path |
| | 80 | Running on "small document" example: |
| | 81 | Just select: 73.852539 microseconds |
| | 82 | __init__ + select: 131.835937 microseconds |
| | 83 | Running on "big document" example: |
| | 84 | Just select: 225.830078 microseconds |
| | 85 | __init__ + select: 285.644531 microseconds |
| | 86 | Testing tag text path |
| | 87 | Running on "small document" example: |
| | 88 | Just select: 93.994141 microseconds |
| | 89 | __init__ + select: 187.988281 microseconds |
| | 90 | Running on "big document" example: |
| | 91 | Just select: 292.968750 microseconds |
| | 92 | __init__ + select: 385.742188 microseconds |
| | 93 | }}} |
| | 94 | |
| | 95 | == Strategies == |
| | 96 | As one can see current implementation is rather faster than previous one. This is because "strategies" were used - for different path different implementations are used. Performance differences between strategies can be seen on following benchmark test's reults. |
| | 97 | |
| | 98 | {{{ |
| | 99 | Testing self path |
| | 100 | Running on "small document" example: |
| | 101 | Just select: 73.242188 microseconds |
| | 102 | __init__ + select: 113.525391 microseconds |
| | 103 | GenericStrategy Strategy |
| | 104 | select: 109.252930 microseconds |
| | 105 | SingleAxisStrategy Strategy |
| | 106 | select: 71.411133 microseconds |
| | 107 | Running on "big document" example: |
| | 108 | Just select: 214.843750 microseconds |
| | 109 | __init__ + select: 253.906250 microseconds |
| | 110 | GenericStrategy Strategy |
| | 111 | select: 327.148438 microseconds |
| | 112 | SingleAxisStrategy Strategy |
| | 113 | select: 213.623047 microseconds |
| | 114 | Testing quite long path |
| | 115 | Running on "small document" example: |
| | 116 | Just select: 65.917969 microseconds |
| | 117 | __init__ + select: 196.533203 microseconds |
| | 118 | GenericStrategy Strategy |
| | 119 | select: 109.252930 microseconds |
| | 120 | SimpleStrategy Strategy |
| | 121 | select: 65.917969 microseconds |
| | 122 | Running on "big document" example: |
| | 123 | Just select: 163.574219 microseconds |
| | 124 | __init__ + select: 292.968750 microseconds |
| | 125 | GenericStrategy Strategy |
| | 126 | select: 278.320313 microseconds |
| | 127 | SimpleStrategy Strategy |
| | 128 | select: 163.574219 microseconds |
| | 129 | Testing quite long + parameter path |
| | 130 | Running on "small document" example: |
| | 131 | Just select: 66.528320 microseconds |
| | 132 | __init__ + select: 214.843750 microseconds |
| | 133 | GenericStrategy Strategy |
| | 134 | select: 109.863281 microseconds |
| | 135 | SimpleStrategy Strategy |
| | 136 | select: 65.307617 microseconds |
| | 137 | Running on "big document" example: |
| | 138 | Just select: 162.353516 microseconds |
| | 139 | __init__ + select: 310.058594 microseconds |
| | 140 | GenericStrategy Strategy |
| | 141 | select: 275.878906 microseconds |
| | 142 | SimpleStrategy Strategy |
| | 143 | select: 163.574219 microseconds |
| | 144 | Testing complicated path |
| | 145 | Running on "small document" example: |
| | 146 | Just select: 111.694336 microseconds |
| | 147 | __init__ + select: 361.328125 microseconds |
| | 148 | GenericStrategy Strategy |
| | 149 | select: 109.863281 microseconds |
| | 150 | Running on "big document" example: |
| | 151 | Just select: 280.761719 microseconds |
| | 152 | __init__ + select: 541.992187 microseconds |
| | 153 | GenericStrategy Strategy |
| | 154 | select: 278.320313 microseconds |
| | 155 | Testing all text path |
| | 156 | Running on "small document" example: |
| | 157 | Just select: 73.852539 microseconds |
| | 158 | __init__ + select: 131.835937 microseconds |
| | 159 | GenericStrategy Strategy |
| | 160 | select: 159.912109 microseconds |
| | 161 | SingleAxisStrategy Strategy |
| | 162 | select: 73.242188 microseconds |
| | 163 | SimpleStrategy Strategy |
| | 164 | select: 92.773437 microseconds |
| | 165 | Running on "big document" example: |
| | 166 | Just select: 224.609375 microseconds |
| | 167 | __init__ + select: 280.761719 microseconds |
| | 168 | GenericStrategy Strategy |
| | 169 | select: 517.578125 microseconds |
| | 170 | SingleAxisStrategy Strategy |
| | 171 | select: 224.609375 microseconds |
| | 172 | SimpleStrategy Strategy |
| | 173 | select: 295.410156 microseconds |
| | 174 | Testing tag text path |
| | 175 | Running on "small document" example: |
| | 176 | Just select: 96.435547 microseconds |
| | 177 | __init__ + select: 191.650391 microseconds |
| | 178 | GenericStrategy Strategy |
| | 179 | select: 153.808594 microseconds |
| | 180 | SimpleStrategy Strategy |
| | 181 | select: 95.825195 microseconds |
| | 182 | Running on "big document" example: |
| | 183 | Just select: 300.292969 microseconds |
| | 184 | __init__ + select: 395.507812 microseconds |
| | 185 | GenericStrategy Strategy |
| | 186 | select: 485.839844 microseconds |
| | 187 | SimpleStrategy Strategy |
| | 188 | select: 295.410156 microseconds |
| | 189 | }}} |