Hi, I am attaching a first shot at indirectly optimizing hashed repair: the patch should drastically limit amount of work wasted on cleaning the caches by passing a list of files that might need to be removed to cleanCaches, which then only looks at that, instead of skimming through everything in the global cache. This should save some cycles, although I have no numbers to back that up. Moreover, the patch as it is is largely untested (just a make check and a quick test that the idea helps things), but I am in a hurry (again), so please review carefully. I will try to revisit this soon.
(Next comes trimming down memory usage, we have discussed that at length on IRC today with Kowey. I'll investigate, hopefully in the course of this week.) Yours, Petr. Tue Oct 7 21:12:37 CEST 2008 Petr Rockai <[EMAIL PROTECTED]> * Optimize clean_hashdir's use of cleanCaches. We now only ask cleanCaches to look at files we have unlinked and therefore might have caused their cached equivalents to drop link-count to 1. Limits number of stats to O(n), n = number of cleaned out files.
New patches: [Optimize clean_hashdir's use of cleanCaches. Petr Rockai <[EMAIL PROTECTED]>**20081007191237 We now only ask cleanCaches to look at files we have unlinked and therefore might have caused their cached equivalents to drop link-count to 1. Limits number of stats to O(n), n = number of cleaned out files. ] hunk ./src/Darcs/Repository/Cache.lhs 8 - unionCaches, cleanCaches, + unionCaches, cleanCaches, cleanCachesWithHint, hunk ./src/Darcs/Repository/Cache.lhs 238 -cleanCaches (Ca cs) subdir = mapM_ cleanCache cs +cleanCaches c d = cleanCachesWithHint' c d Nothing + +cleanCachesWithHint :: Cache -> HashedDir -> [String] -> IO () +cleanCachesWithHint c d h = cleanCachesWithHint' c d (Just h) + +cleanCachesWithHint' :: Cache -> HashedDir -> Maybe [String] -> IO () +cleanCachesWithHint' (Ca cs) subdir hint = mapM_ cleanCache cs hunk ./src/Darcs/Repository/Cache.lhs 247 - do fs <- getDirectoryContents "." + do fs' <- getDirectoryContents "." + let fs = case hint of + Just h -> h + Nothing -> fs' hunk ./src/Darcs/Repository/HashedIO.lhs 39 - okayHash, cleanCaches, HashedDir(..), hashedDir ) + okayHash, cleanCachesWithHint, HashedDir(..), hashedDir ) hunk ./src/Darcs/Repository/HashedIO.lhs 406 - cleanCaches c dir_ + cleanCachesWithHint c dir_ (fs \\ hs) Context: [fix issue966 test, use better temp dir name, and start clean Tommy Pettersson <[EMAIL PROTECTED]>**20081005000117] [fix wrong ../path in failing issue1013 test Tommy Pettersson <[EMAIL PROTECTED]>**20081004140200] [mv issue1111 to tests/ David Roundy <[EMAIL PROTECTED]>**20081004143649 Ignore-this: 51683a80094a4d7733a31b4a40e94016 ] [resolve issue1111: patchset_intersection used wrong selection for partitionRL Tommy Pettersson <[EMAIL PROTECTED]>**20081004123851 We want to commute the non-common patches away, so we can stick the remaining common patches to the rest of the common patch set. ] [use longer patch names in issue1111 test for safer grep result Tommy Pettersson <[EMAIL PROTECTED]>**20081003230323 The 'not grep C out' found the author--date line of patch A, which contained my timezone (CEST), so the test failed even when it should have succeeded. ] [The pager defaults to less(1), not more(1) Matthias Kilian <[EMAIL PROTECTED]>**20081003212319 It would be better to change get_viewer in Darcs/Utils.lhs to default to more(1), but since this may be too intrusive for the upcoming release, just let the manual tell the truth (i.e., we're using less(1) by default). ] [Fix cd bugs in conflict-doppleganger test. Eric Kow <[EMAIL PROTECTED]>**20081004094407 We were not always exiting from darcs repositories when we meant to. ] [fix test issue1110, remove duplicates of cd .. Tommy Pettersson <[EMAIL PROTECTED]>**20081003182126 They got us out of the test dir, up in the file tree hierarchy, to the darcs root dir, and beyond, where the test continued to run test commands and cleanups (ooops!!) ] [Add a shell test template. Eric Kow <[EMAIL PROTECTED]>**20081003095005 This provides helper functions and a basic repository setup. The idea is that when making a new shell test, you start by making a copy of the template. ] [Reformat Darcs.CommandsAux comments as haddock. Eric Kow <[EMAIL PROTECTED]>**20080927123217] [haddock documentation for ColorPrinter Tommy Pettersson <[EMAIL PROTECTED]>**20081003175214] [only show 'diffing dir' when debugging. David Roundy <[EMAIL PROTECTED]>**20081001134124 Ignore-this: 277810d9083e36b42f27fa7ac4c47386 ] [TAG 2.1.0pre3 Eric Kow <[EMAIL PROTECTED]>**20081002091241] Patch bundle hash: 9501a87fceee8743b8f2eb7b3fd458aebb2184e2
_______________________________________________ darcs-users mailing list [email protected] http://lists.osuosl.org/mailman/listinfo/darcs-users
