Skip to content

WordprocessingDocument.Open is very slow #628

Closed
@amanbolat

Description

@amanbolat

Description

WordprocessingDocument.Open is very very slow when reading big .docx document.
i'm trying to read 10 mb sized .docx document and it takes about 1 minute just to open it.

Information

  • .NET Target: .NET Core 2.2
  • DocumentFormat.OpenXml Version: 2.9.0

Repro

Console.WriteLine("Creating filter")
using (var doc = WordprocessingDocument.Open(path, false))
{
        Console.WriteLine("Creating BodyReader");
        _bodyReader = OpenXmlReader.Create(doc.MainDocumentPart.Document);
}

Link to the file: https://drive.google.com/file/d/1_InQLbZ19KCUgkuePAiLXvUuLcZl6Qu7/view?usp=sharing

Uploaded to GitHub: 10mb_file.docx

Observed

I put to lines of Console.WriteLine so the time between "Creating filter" and "Creating BodyReader" is about 1 min. It doesn't matter if i opening file from memory stream or just giving it a real path to the file.

Expected

Instant open expected :)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions