Skip to content

[C++20] [Modules] Writing PCM will be unexpectedly slow with additional import. #61447

Open
@ChuanqiXu9

Description

@ChuanqiXu9

We can find the reproducer at: https://discourse.llvm.org/t/modules-increased-build-times/68755/7

For short:

// test.cppm
module;

#include <iostream>

export module test;
import vulkan; // Vulcan is constructed big module.

will take 3~4s to generate the PCM.

And

module;
#include <iostream>
export module test.without.import;

will take about 0.5s to complete only.

Note that:

#include <iostream>
import vulkan;

will take 0.5s to complete too.

Currently I located in ASTWriter::WriteDecl. But I am not sure if this can be fixed simply.

Metadata

Metadata

Assignees

Labels

clang:modulesC++20 modules and Clang Header Modules

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions