Code Monkey home page Code Monkey logo

Comments (6)

enkore avatar enkore commented on August 15, 2024

Can we efficiently access random items in metadata[b'items']? The code accessing that so far is strictly linear access.

If we could, a directory tree index could be added separately, only containing indexes into the items. This could speed up all content-reading actions significantly if only a subset is accessed.

Edit: Ah, no, msgpack only has a streaming unpacker it seems. But maybe we can seek before feeding data to unpacker and this way emulate random access?

from borg.

RonnyPfannschmidt avatar RonnyPfannschmidt commented on August 15, 2024

basically to make this safe, there is need for dependency tracking, so metadata of a directory will only get written after its content is done

this could be tracked as tree of contents that constructs as unpacking is done, and deconstructs as items are written,

every time a treee turns empty, we can write directory metadata

the pipeline can be created in a way that a tree cannot turn empty unless all its content is processed

from borg.

enkore avatar enkore commented on August 15, 2024

That would make it unnecessary to make another pass over all dirs in borg extract, but doesn't speed up "random access" to directories / files for listing/extracting subtrees.

Concrete example: listing all files in /home takes a minute or so, listing a subtree with a few dozen files still takes ~20 s (because iter_items / unpack_many needs to read, unpack, decode, filter all items)

from borg.

RonnyPfannschmidt avatar RonnyPfannschmidt commented on August 15, 2024

well, a backup tool has to make some trade-offs, - since the metadata is supposed to be sorted, i believe that binary search is reasonably fast for that kind of access

from borg.

enkore avatar enkore commented on August 15, 2024

If I understand things correctly accessing items non-linearly is not trivial to do.

from borg.

enkore avatar enkore commented on August 15, 2024

(I'm not saying that this is an actual problem that needs solving, I think it's "fast enough", at least for me)

from borg.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.