Commit Graph

6 Commits

Author SHA1 Message Date
Durham Goode
bced440ce6 ctree: implement find
Summary:
This implements treemanifest.find(), which takes a filename and returns the node
and flag for it, if it exists.

This isn't the prettiest function I've ever written.  I need to think about how
to refactor this to unify the various traversal algorithms that are used in
treemanifest.

Test Plan:
Ran it as part of a perf test suite. It's basically 0 milliseconds in
every case.

Reviewers: #fastmanifest

Differential Revision: https://phabricator.intern.facebook.com/D3645967
2016-08-08 12:16:25 -07:00
Durham Goode
d5ae2f2fdf ctree: implement __iter__
Summary:
This implements the basic __iter__ logic. It returns an iterator that returns
every file path in the manifest.

Test Plan:
Ran a separate perf test suite to verify the performance of this. It
can iterate over 1 million files in about 550 milliseconds, assuming a fast
store.

Reviewers: #fastmanifest

Differential Revision: https://phabricator.intern.facebook.com/D3645890
2016-08-08 12:16:25 -07:00
Durham Goode
f3263cc7ab ctree: define basic fileiter type
Summary:
This defines the basic type for representing an iteration over all the keys in
the treemanifest. The next patch fill add the logic that constructs and mutates
this type as it iterates.

Test Plan: I ran a perf test in a future patch that executes all of this code.

Reviewers: #fastmanifest

Differential Revision: https://phabricator.intern.facebook.com/D3645768
2016-08-08 12:16:25 -07:00
Durham Goode
28b736554e ctree: add common helper methods
Summary:
This adds getdata and binfromhex functions. These are common functions that will
be used throughout the implementation of the ctreemanifest.

Test Plan: Ran a perf test suit on the code in a later diff.

Reviewers: #fastmanifest

Differential Revision: https://phabricator.intern.facebook.com/D3644960
2016-08-08 12:16:25 -07:00
Durham Goode
d55020433d ctree: add an initial c type definition for treemanifest
Summary:
This is the basic definition of the c treemanifest type. Future patches will add
functions to this type.

Test Plan: Tested by running a perf suite on a later version of this series

Reviewers: #fastmanifest

Differential Revision: https://phabricator.intern.facebook.com/D3644935
2016-08-08 12:16:25 -07:00
Durham Goode
aa0ad156a2 ctree: adds an initial cpython file for the ctreemanifest implementation
Summary: Just a simple module declaration with no logic yet.

Test Plan: Ran perf tests against a later implementation of this

Reviewers: #fastmanifest

Differential Revision: https://phabricator.intern.facebook.com/D3644720
2016-08-08 12:16:25 -07:00