Skip to content

mimetype is super slow for big binary filenodes #37

@lukaszb

Description

@lukaszb

Ok like in the title, i found that the node.is_binary function really messes things up.

{{{

!python

@LazyProperty
def is_binary(self):
    """
    Returns True if file has binary content.
    """          
    return bool(self.content and '\0' in self.content)

}}}

It looks like this is a CPU killer, for content files with let's say 70MB binary file.

I think it's need to be rewrite the to a lazy read in chunk generator for the content. That should speed up things a lot.


Reference: https://bitbucket.org/marcinkuzminski/vcs/issues/37/

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions