1. Radomir Dopieralski
  2. hatta
  3. Issues
Issue #45 resolved

Consider using repository for page existence checks

Radomir Dopieralski
repo owner created an issue

Currently Hatta checks page existence by directly looking if the file exists. Even if the file is not tracked by the repository, it's considered existing if the file is there. This was done for efficiency reasons -- checking for page existence is a common action and the repository access may be slow... But it was never actually verified. It may as well happen that checking whether a file is tracked in an already opened repository is actually faster. This has to be tested.

Comments (4)

  1. Radomir Dopieralski reporter

    sheep on 2010-08-19 07:20:46 said:

    File-based existence check

    Three tries, 1000000 iterations each, result in seconds.

    • 13.228314876556396
    • 13.181467056274414
    • 13.136298894882202

    Repository-based existence check

    Three tries, 1000000 iterations each, result in seconds.

    • 46.087460041046143
    • 46.297327041625977
    • 46.148791790008545

    So it's 3.5 times slower... furthermore, I can double the speed of the file-based check by not checking for symbolic links, which would make the repo check 7 times slower!

  2. Radomir Dopieralski reporter

    sheep on 2010-08-19 07:26:07 said:

    On the other hand, if I don't do the lookup for "tip", I get marvelous speedup!

    File

    [6.3039121627807617, 6.3666200637817383, 6.327131986618042]

    Repo

    [1.1299951076507568, 1.1295170783996582, 1.129889965057373]

  3. Log in to comment