Sun, 27 Sep 2015 16:08:18 -0700 revlog: use existing file handle when reading during _addrevision
Gregory Szorc <gregory.szorc@gmail.com> [Sun, 27 Sep 2015 16:08:18 -0700] rev 26379
revlog: use existing file handle when reading during _addrevision _addrevision() may need to read from revlogs as part of computing deltas. Previously, we would flush existing file handles and open a new, short-lived file handle to perform the reading. If we have an existing file handle, it seems logical to reuse it for reading instead of opening a new file handle. This patch makes that the new behavior. After this patch, revlog files are only reopened when adding revisions if the revlog is switched from inline to non-inline. On Linux when unbundling a bundle of the mozilla-central repo, this patch has the following impact on system call counts: Call Before After Delta write 827,639 673,390 -154,249 open 700,103 684,089 -16,014 read 74,489 74,489 0 fstat 493,924 461,896 -32,028 close 249,131 233,117 -16,014 stat 242,001 242,001 0 lstat 18,676 18,676 0 lseek 20,268 20,268 0 ioctl 14,652 13,173 -1,479 TOTAL 3,180,758 2,930,679 -250,079 It's worth noting that many of the open() calls fail due to missing files. That's why there are many more open() calls than close(). Despite the significant system call reduction, this change does not seem to have a significant performance impact on Linux. On Windows 10 (not a VM, on a SSD), this patch appears to reduce unbundle time for mozilla-central from ~960s to ~920s. This isn't as significant as I was hoping. But a decrease it is nonetheless. Still, Windows unbundle performance is still >2x slower than Linux. Despite the lack of significant gains, fewer system calls is fewer system calls. If nothing else, this will narrow the focus of potential areas to optimize in the future.
Sun, 27 Sep 2015 15:59:19 -0700 revlog: always open revlogs for reading and appending
Gregory Szorc <gregory.szorc@gmail.com> [Sun, 27 Sep 2015 15:59:19 -0700] rev 26378
revlog: always open revlogs for reading and appending An upcoming patch will teach revlogs to use the existing file handle to read revision data instead of opening a new file handle just for quick reads. For this to work, files must be opened for reading as well. This patch is merely cosmetic: there are no behavior changes.
Sun, 27 Sep 2015 15:48:35 -0700 revlog: support using an existing file handle when reading revlogs
Gregory Szorc <gregory.szorc@gmail.com> [Sun, 27 Sep 2015 15:48:35 -0700] rev 26377
revlog: support using an existing file handle when reading revlogs Currently, the low-level revlog reading code always opens a new file handle. In some key scenarios, the revlog is already opened and an existing file handle could be used to read. This patch paves the road to that by teaching various revlog reading functions to accept an optional existing file handle to read from.
Sun, 27 Sep 2015 15:31:50 -0700 revlog: add docstring for checkinlinesize()
Gregory Szorc <gregory.szorc@gmail.com> [Sun, 27 Sep 2015 15:31:50 -0700] rev 26376
revlog: add docstring for checkinlinesize() The name is deceptive: it does more than just "check." Add a docstring to clarify what's going on.
Sun, 27 Sep 2015 18:46:53 -0700 windows: insert file positioning call between reads and writes
Gregory Szorc <gregory.szorc@gmail.com> [Sun, 27 Sep 2015 18:46:53 -0700] rev 26375
windows: insert file positioning call between reads and writes fopen() and fdopen() have a unique-to-Windows requirement that transitions between read and write operations in files opened in modes r+, w+, and a+ perform a file positioning call (fsetpos, fseek, or rewind) in between. While the MSDN docs don't say what will happen if this is not done, observations reveal that Python raises an IOError with errno 0. Furthermore, I /think/ this behavior isn't deterministic. But I can reproduce it reliably with subsequent patches applied that open revlogs in a+ mode and perform both reads and writes. This patch introduces a proxy class for file handles opened in r+, w+, and a+ mode on Windows. The class intercepts calls and audits whether a file positioning function has been called between read and write operations. If not, a dummy, no-op seek to the current file position is performed. This appears to be sufficient to "trick" Windows into allowing transitions between read and writes without raising errors.
Sat, 26 Sep 2015 15:20:32 +0900 tests: suppress verbose output of svn transaction
Yuya Nishihara <yuya@tcha.org> [Sat, 26 Sep 2015 15:20:32 +0900] rev 26374
tests: suppress verbose output of svn transaction Subversion 1.9 shows more verbose messages than 1.8 and the tests fail because of them. These outputs are not important in our tests, so let's suppress them by -q or grep -v.
Wed, 23 Sep 2015 21:54:47 +0900 formatter: use dict.update() to set arguments passed to write functions
Yuya Nishihara <yuya@tcha.org> [Wed, 23 Sep 2015 21:54:47 +0900] rev 26373
formatter: use dict.update() to set arguments passed to write functions This isn't important, but update() is better than loop in general.
Wed, 23 Sep 2015 21:51:48 +0900 formatter: verify number of arguments passed to write functions
Yuya Nishihara <yuya@tcha.org> [Wed, 23 Sep 2015 21:51:48 +0900] rev 26372
formatter: verify number of arguments passed to write functions zip() takes the shortest length, which can be a source of bug.
Sat, 26 Sep 2015 11:50:47 +0900 help: unify handling of DEPRECATED/EXPERIMENTAL keywords
Yuya Nishihara <yuya@tcha.org> [Sat, 26 Sep 2015 11:50:47 +0900] rev 26371
help: unify handling of DEPRECATED/EXPERIMENTAL keywords This fixes listexts() to exclude translated "(DEPRECATED)" marker correctly. On the other hand, help_() doesn't need translated keywords, but I don't think it's worth to separate untranslated keywords just for it.
Sat, 26 Sep 2015 11:38:39 +0900 help: include parens in DEPRECATED/EXPERIMENTAL keywords
Yuya Nishihara <yuya@tcha.org> [Sat, 26 Sep 2015 11:38:39 +0900] rev 26370
help: include parens in DEPRECATED/EXPERIMENTAL keywords In some languages that have no caps, "DEPRECATED" and "deprecated" can be translated to the same byte sequence. So it is too wild to exclude messages by _("DEPRECATED").
(0) -10000 -3000 -1000 -300 -100 -10 +10 +100 +300 +1000 +3000 +10000 tip