Review main Abandoned

25769[TASK] Optimization of GeneralUtility::get_dirs()

Michiel Roos CR 0 V 0 Easy +14 −12 updated 09/08/14, 08:15

Commit message

Use glob() instead of scandir()

Review

  • Code review CR 0
  • Verified V 0

Issues 1

Files 1

Review log 21

  1. Wouter Wolters wrote 11/29/13, 18:05

    Topic set to "performance".
  2. Michiel Roos commented on patch set 1 11/29/13, 18:06

  3. Wouter Wolters voted on patch set 1 CR +1 11/29/13, 18:12

  4. Mr. Jenkins commented on patch set 1 11/29/13, 18:18

  5. Markus Klein commented on patch set 1 11/29/13, 23:56

    GeneralUtility.php:2759

    $path . '/*'

    GeneralUtility.php:2760

    Is the check for '..' and '.' not necessary anymore?

    GeneralUtility.php:2761

    I don't think it is a good idea to modify the array we're just traversing.
  6. Michiel Roos uploaded patch set 2 11/30/13, 21:57

  7. Michiel Roos commented on patch set 2 11/30/13, 21:59

    New tests: http://pastebin.com/TfYL72Pd http://www.typofree.org/fileadmin/get_dirs.php The version that also finds hidden directories still completes in 40% of the time of the currently used function.
  8. Mr. Jenkins commented on patch set 2 11/30/13, 22:09

  9. Markus Klein voted on patch set 2 CR +1 11/30/13, 22:15

  10. Christian Kuhn commented on patch set 2 CR -1 12/01/13, 11:00

    get_dirs currently only has basic unit test coverage looking for error handling. please add at least one test to verify expected result.
  11. Oliver Klee commented on patch set 2 CR -1 12/08/13, 12:05

    One note concerning unit testing: If we cover this method with unit tests using VfsStream, we cannot use glob as vfsstream does not work with glob. scandir works fine, though. See this ticket for details: https://github.com/mikey179/vfsStream/issues/2
  12. Dmitry Dulepov commented on patch set 2 12/09/13, 13:07

    Can have problems here: - glob() does not work on non-local paths (like mounted NFS shares) - glob() returns FALSE if open_basedir is enabled and the path is not inside the open_basedir
  13. Michiel Roos commented on patch set 2 01/10/14, 13:16

    Ok, glob is out because of a bug in glibc: https://bugs.php.net/bug.php?id=22641&edit=3
  14. Oliver Hader commented on patch set 2 01/13/14, 13:14

    Michiel, did you analyze or experience that behaviour? The issue you mentioned points back to 2003 - more than 10 years ago
  15. Michiel Roos commented on patch set 2 01/13/14, 13:27

    Oooh, 2003. Nice catch! No, I did not. Will do maybe this evening.
  16. Michiel Roos commented on patch set 2 01/13/14, 23:46

    This seems to be fixed. On Mavericks at least. Connecting to a Ubuntu NFS. No files are found, only dirs.
  17. Michiel Roos commented on patch set 2 01/13/14, 23:58

    Here's a new permanent pastie for verification: http://pastebin.com/2ZcP4uCD
  18. Michiel Roos commented on patch set 2 02/04/14, 12:19

    Dmitry, Can you please attempt to verify that this indeed does break on NFS? The bug is from 2003 and it's now 2014. Thank you.
  19. Michiel Roos abandoned the change 02/17/14, 21:35

    Since nobody is brave enough to test this, I'm abandoning my child. It may return in the upcomming 6.2 JetPack extension / patch set that will contain more of these abandoned improvements.
  20. Stephan Großberndt commented on patch set 2 09/05/14, 18:53

    Still nobody using NFS? I don't - otherwise I'd test it...
  21. Michiel Roos commented on patch set 2 09/08/14, 08:15

    It's not that hard to set up a test environment in a virtual machine.