webkitpy: speed up hot filesystem_mock functions
authordpranke@chromium.org <dpranke@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 22 Feb 2012 00:32:33 +0000 (00:32 +0000)
committerdpranke@chromium.org <dpranke@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 22 Feb 2012 00:32:33 +0000 (00:32 +0000)
commit21bf97695455dd5ef41bc9ed5339733e9f1e7a37
tree0bb0d235c665c6eba980df5df6eac6ec0e275855
parentf30f618ab83013f9e4512ea7e11c74b74b701a62
webkitpy: speed up hot filesystem_mock functions
https://bugs.webkit.org/show_bug.cgi?id=79159

Reviewed by Adam Barth.

Profiling run_webkit_tests_integrationtest.py revealed that
isdir(), normpath(), and join() are called a lot and were very
slow.This patch speeds them up substantially, shaving 20 seconds
off of the execution time.

* Scripts/webkitpy/common/system/filesystem_mock.py:
(MockFileSystem.isdir):
(MockFileSystem._slow_but_correct_join):
(MockFileSystem.join):
(MockFileSystem.listdir):
(MockFileSystem._slow_but_correct_normpath):
(MockFileSystem.normpath):
(MockFileSystem.write_binary_file):
* Scripts/webkitpy/common/system/filesystem_mock_unittest.py:
(MockFileSystemTest.quick_check):
(MockFileSystemTest):
(MockFileSystemTest.test_join):
(MockFileSystemTest.test_normpath):
* Scripts/webkitpy/tool/servers/rebaselineserver_unittest.py:
(get_test_config): Call write_binary_file() instead of updating
  filesystem.files directly, so that we create directories as
  needed.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@108414 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Tools/ChangeLog
Tools/Scripts/webkitpy/common/system/filesystem_mock.py
Tools/Scripts/webkitpy/common/system/filesystem_mock_unittest.py
Tools/Scripts/webkitpy/tool/servers/rebaselineserver_unittest.py