Review main Merged

63056[BUGFIX] Cast integer to string items during route argument mapping

Oliver Hader CR +2 V +2 Easy +28 −5 updated 02/01/20, 18:06

Commit message

Review

  • Code review CR +2 Done
    • Andreas Kienast +2
    • Guido Schmechel +1
    • Benni Mack +1
  • Verified V +2 Done
    • Andreas Kienast +2
    • Benni Mack +1
    • TYPO3com +1 CI

Issues 1

Files 2

Review log 1419

  1. Oliver Hader uploaded patch set 1 01/28/20, 13:16

  2. Oliver Hader voted on patch set 1 CR -1 01/28/20, 13:20

  3. TYPO3com voted on patch set 1 V -1 01/28/20, 13:26 Completed build in 10m 09s on Tue, 28 Jan, 01:26 PM Test Summary: 70547 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-40291

  4. Oliver Hader uploaded patch set 2 01/28/20, 13:26

  5. TYPO3com voted on patch set 2 V -1 01/28/20, 13:37 Completed build in 10m 51s on Tue, 28 Jan, 01:37 PM Test Summary: 70345 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-40292

  6. TYPO3com voted on patch set 2 V +1 01/28/20, 14:02 Completed build in 46m 25s on Tue, 28 Jan, 02:02 PM Test Summary: 70852 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-40292

  7. Benni Mack commented on patch set 2 CR +1 01/28/20, 17:41

    VariableProcessor.php:418

    Just use array_map on all places directly ;). otherwise we could open up a discussion on what is more performant and if we should move this logic into ArrayUtility...
  8. Oliver Hader commented on patch set 2 01/28/20, 21:07

    VariableProcessor.php:418 Reply

    No need to discuss... without guard clause it's 60% slower on an empty array ;) +--------------+---------------------------+-----+---------+-----+----------+---------+---------+---------+---------+---------+--------+-------+ | benchmark | subject | set | revs | its | mem_peak | best | mean | mode | worst | stdev | rstdev | diff | +--------------+---------------------------+-----+---------+-----+----------+---------+---------+---------+---------+---------+--------+-------+ | InArrayBench | benchArrayMapWithoutGuard | 0 | 1000000 | 1 | 464,064b | 1.403μs | 1.403μs | 1.403μs | 1.403μs | 0.000μs | 0.00% | 1.62x | | InArrayBench | benchArrayMapWithGuard | 0 | 1000000 | 1 | 464,056b | 0.867μs | 0.867μs | 0.867μs | 0.867μs | 0.000μs | 0.00% | 1.00x | +--------------+---------------------------+-----+---------+-----+----------+---------+---------+---------+---------+---------+--------+-------+
  9. Georg Ringer voted on patch set 2 V +1 CR +1 01/29/20, 05:39

  10. Helmut Hummel commented on patch set 2 01/29/20, 11:59

    VariableProcessor.php:418 Reply

    60% at a scale of 0.6 microseconds. If this code isn't called thousands of times (which I in fact don't know wheter it acutually is, but assume it is not), this performance benefit will be easily "eaten" by network latencies to a degree of not being measurable any more. If you still think such optimizations are worth it, it may be worth cosidering removing the additional method call, which makes up for a similar (but indeed not quite as much) performance improvement as the guard clause (from my measurements), or even removing the method type hints from the closures and casting the values to string in that closure(s) instead. ;)
  11. Helmut Hummel commented on patch set 2 01/29/20, 12:00

    VariableProcessor.php:413 Unresolved

    I'd at least make this method private, but indeed rather remove it and use array_map directly or removing the type hints from the closures
  12. Oliver Hader uploaded patch set 3 01/29/20, 12:57

  13. TYPO3com voted on patch set 3 V -1 01/29/20, 13:09 Completed build in 12m 27s on Wed, 29 Jan, 01:09 PM Test Summary: 70841 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-40320

  14. TYPO3com voted on patch set 3 V +1 01/29/20, 13:18 Completed build in 33m 35s on Wed, 29 Jan, 01:18 PM Test Summary: 70852 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-40320

  15. Oliver Hader commented on patch set 3 01/29/20, 13:51

    VariableProcessor.php:418 Reply Unresolved

    > 60% at a scale of 0.6 microseconds. If this code isn't called thousands of times (which I in fact don't know wheter it acutually is, but assume it is not), this performance benefit will be easily "eaten" by network latencies to a degree of not being measurable any more. > > If you still think such optimizations are worth it, it may be worth cosidering removing the additional method call, which makes up for a similar (but indeed not quite as much) performance improvement as the guard clause (from my measurements), or even removing the method type hints from the closures and casting the values to string in that closure(s) instead. ;) As an example, using the news extension with a couple of news and categories and rending the page invokes this part around 1.000 times - this will grow with the amount of news and categories URLs are generated for (it's 10 for both in my example). The amount of invocations grows with the amount of URLs being handled and route enhancers (more specifically: combination of routePaths, defaults, requirements and aspects being used for each). Thus, scenarios where the given method is called 10.000 and more exists... In my local test case the difference was 30 ms (with a total rendering time of 1200 ms) which indeed does not matter in terms of network latency and is in std.deviation as well. I just wanted to point out that this is not just a theoretical thing - it can measured for the whole application.
  16. Benni Mack voted on patch set 3 V +1 CR +1 01/30/20, 07:26

  17. Guido Schmechel voted on patch set 3 CR +1 02/01/20, 13:20

  18. Andreas Kienast voted on patch set 3 V +2 CR +2 02/01/20, 18:06

  19. Andreas Kienast merged patch set 4 02/01/20, 18:06