Skip to content

Rendering comments can be time consuming. #682

Description

@ardenwick
$ time protoc -I . --python_betterproto_out=. douyin2.proto |& head
Writing __init__.py
Writing douyin\__init__.py

real    6m18.150s
user    0m0.015s
sys     0m0.091s

After patching betterproto/plugin/models.py@ProtoContentBase.comment to return empty string, it's much faster

$ time protoc -I . --python_betterproto_out=. douyin2.proto |& head
Writing __init__.py
Writing douyin\__init__.py

real    0m23.077s
user    0m0.000s
sys     0m0.092s

Profile flamegraph from py-spy record

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions