{"thread":{"id":"48147","subject":"core.fsmonitor always perform rescans","startedAt":"2018-03-26T04:41:39Z","lastAt":"2018-04-11T08:18:23Z","messageCount":4,"participants":["Tatsuyuki Ishi","Johannes Schindelin","Ben Peart"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"342962","messageId":"CANqewP332-+esYWDPBtPif==wnb4PiNd89R1qTZsuWZAFSV0ew@mail.gmail.com","threadId":"48147","inReplyTo":null,"subject":"core.fsmonitor always perform rescans","fromName":"Tatsuyuki Ishi","fromEmail":"ishitatsuyuki@gmail.com","sentAt":"2018-03-26T04:41:34Z","receivedAt":"2018-03-26T04:41:39Z","isPatch":false,"sender":{"key":"ishitatsuyuki@gmail.com","avatar":null},"body":"Hello,\n\nI'm facing issue with core.fsmonitor.\n\nI'm currently using the provided watchman hook, but it doesn't seem to\nrecord the fact that it has queried the fsmonitor backend, and as a\nresult the timestamp passed to the hook doesn't seem to change.\n\nAs it always pass a timestamp before watchman has crawled the\ndirectories, watchman will always return all files inside the\ndirectory. This happens everytime I run a git command, resulting in\nslowness.\n\nIs the timestamp not being updated an intended behavior, or is this a bug?\n\nTatsuyuki Ishi\n"},{"id":"343397","messageId":"nycvar.QRO.7.76.6.1803301226400.5026@qfpub.tvgsbejvaqbjf.bet","threadId":"48147","inReplyTo":"CANqewP332-+esYWDPBtPif==wnb4PiNd89R1qTZsuWZAFSV0ew@mail.gmail.com","subject":"Re: core.fsmonitor always perform rescans","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2018-03-30T10:28:00Z","receivedAt":"2018-03-30T10:28:08Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Mon, 26 Mar 2018, Tatsuyuki Ishi wrote:\n\n> I'm facing issue with core.fsmonitor.\n> \n> I'm currently using the provided watchman hook, but it doesn't seem to\n> record the fact that it has queried the fsmonitor backend, and as a\n> result the timestamp passed to the hook doesn't seem to change.\n> \n> As it always pass a timestamp before watchman has crawled the\n> directories, watchman will always return all files inside the\n> directory. This happens everytime I run a git command, resulting in\n> slowness.\n> \n> Is the timestamp not being updated an intended behavior, or is this a bug?\n\nThere are some bug fixes pending, and IIRC Alex was even working on some\nmore patches that are in an intermediate stage. Alex, could you share them\nwith us (even in their unfinished state, maybe others can help)?\n\nCiao,\nJohannes\n"},{"id":"344347","messageId":"53251802-5c5e-6fd2-25d0-40d534e6bd6f@gmail.com","threadId":"48147","inReplyTo":"CANqewP332-+esYWDPBtPif==wnb4PiNd89R1qTZsuWZAFSV0ew@mail.gmail.com","subject":"Re: core.fsmonitor always perform rescans","fromName":"Ben Peart","fromEmail":"peartben@gmail.com","sentAt":"2018-04-10T14:34:05Z","receivedAt":"2018-04-10T14:34:13Z","isPatch":false,"sender":{"key":"benpeart@microsoft.com","avatar":"https://avatars.githubusercontent.com/u/15252029?v=4"},"body":"\n\nOn 3/26/2018 12:41 AM, Tatsuyuki Ishi wrote:\n> Hello,\n> \n> I'm facing issue with core.fsmonitor.\n> \n> I'm currently using the provided watchman hook, but it doesn't seem to\n> record the fact that it has queried the fsmonitor backend, and as a\n> result the timestamp passed to the hook doesn't seem to change.\n> \n> As it always pass a timestamp before watchman has crawled the\n> directories, watchman will always return all files inside the\n> directory. This happens everytime I run a git command, resulting in\n> slowness.\n> \n> Is the timestamp not being updated an intended behavior, or is this a bug?\n> \n\nAs a performance optimization, the fsmonitor code doesn't flag the index \nas dirty and force it to be written out with every command.  Can you try \nperforming a git operation (add, rm, commit, etc) that will write out an \nupdated index and see if that fixes the issue you're seeing?\n\nI'm considering adding a special case to force the index to be written \nout the first time fsmonitor is invoked and am interested to know if \nthis would have avoided the issue you are seeing.\n\nThanks!\n\n> Tatsuyuki Ishi\n> \n"},{"id":"344447","messageId":"CANqewP1W2dPotMFhWRLRkjteUpmH9z0fRWCQG_h5bF95EAy60w@mail.gmail.com","threadId":"48147","inReplyTo":"53251802-5c5e-6fd2-25d0-40d534e6bd6f@gmail.com","subject":"Re: core.fsmonitor always perform rescans","fromName":"Tatsuyuki Ishi","fromEmail":"ishitatsuyuki@gmail.com","sentAt":"2018-04-11T08:18:15Z","receivedAt":"2018-04-11T08:18:23Z","isPatch":false,"sender":{"key":"ishitatsuyuki@gmail.com","avatar":null},"body":"2018-04-10 23:34 GMT+09:00 Ben Peart <peartben@gmail.com>:\n> As a performance optimization, the fsmonitor code doesn't flag the index as\n> dirty and force it to be written out with every command.  Can you try\n> performing a git operation (add, rm, commit, etc) that will write out an\n> updated index and see if that fixes the issue you're seeing?\n\nYeah, that resolves the issue. Though the repo I'm working on uses\nsubmodules, so doing this in each of them isn't a easy work.\n\n> I'm considering adding a special case to force the index to be written out\n> the first time fsmonitor is invoked and am interested to know if this would\n> have avoided the issue you are seeing.\n\nYes please. And maybe we should also flush the index when the script\nreturns '/',\nwhich means all files?\n"}]}