{"thread":{"id":"4552","subject":"parsecvs leaks and optimizations","startedAt":"2006-06-18T05:15:10Z","lastAt":"2006-06-18T05:15:10Z","messageCount":1,"participants":["Jon Smirl"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"21989","messageId":"9e4733910606172215t2d1e987g207d1d394a6f92b@mail.gmail.com","threadId":"4552","inReplyTo":null,"subject":"parsecvs leaks and optimizations","fromName":"Jon Smirl","fromEmail":"jonsmirl@gmail.com","sentAt":"2006-06-18T05:15:10Z","receivedAt":"2006-06-18T05:15:10Z","isPatch":false,"sender":{"key":"jonsmirl@gmail.com","avatar":"https://gravatar.com/avatar/cff3bf5bfdfa6708b905712ff91f0f9b8aaca161659f38c02b787920d5d28b7e?d=mp&s=160"},"body":"#1) the seen field is wrapping, char is too small.\n\n#2)\nstatic void\nrev_tag_search (rev_ref **tags, int ntag, rev_ref *tag, rev_list *rl)\n{\n    rev_commit\t**commits = calloc (ntag, sizeof (rev_commit *));\n    int\t\tn;\n\n    for (n = 0; n < ntag; n++)\n\tcommits[n] = tags[n]->commit;\n    ntag = rev_commit_date_sort (commits, ntag);\n\n    tag->parent = rev_branch_of_commit (rl, commits[0]);\n    if (tag->parent)\n\ttag->commit = rev_commit_locate (tag->parent, commits[0]);\n    if (!tag->commit) {\n\ttag->commit = rev_commit_build (commits, ntag);\n>>> everything from here is leaking\n    }\n    free (commits);\n}\n\n#3) cvs_find_symbol is very hot, probably should be a hash. Mozilla\nhas thousands of symbols.\n\n#4) rcs2git is n-squared and parses the file over and over to get the\nrevs. The n-squared really hurts when a ,v file is 45MB. A single pass\nalgorithm would work wonders. Or at least cache the offsets to the\nrevs as they are found. Can the revs be written straight to a pack\nfile and then connected up with a tree later?\n\n#5) This small group fails, parsecvs sends a null to git. Git dies.\n/home/mozcvs/mozilla/Makefile.in,v\n/home/mozcvs/mozilla/.cvsignore,v\n/home/mozcvs/mozilla/LEGAL,v\n/home/mozcvs/mozilla/LICENSE,v\n/home/mozcvs/mozilla/README.txt,v\n/home/mozcvs/mozilla/aclocal.m4,v\n/home/mozcvs/mozilla/camino.mk,v\n\n#6) comparing versions is very hot. Could versions be encoded into a\nlong or long long for more efficient comparisons? Packed bit field\nunioned with long. Checks on initial parsing to make sure fields don't\nover flow.\n\nI'm working on some global analysis to try and track down the missing\nbranch tags but it is very slow going. It would be better to speed up\nthe basic process first.\n\n-- \nJon Smirl\njonsmirl@gmail.com\n"}]}