Skip to content

[BUG] Long runtime of "finite" test for protos of 10k-100k doubles. #153

Description

@glenn-elliott

Description

My application uses protobufs that are dominated by a large number (10k-100k) of numerical values (predominately, double). Validating that every value is finite via protovalidate-cc ((buf.validate.field).double.finite = true) takes nearly 100ms on my system. It looks like a change to use a native, non-CEL, function that calls std::isfinite in a for-loop for a repeated double field is straightforward within protovalidate-cc's well-structured code-base. Indeed, I've experimented with this change within protovalidate-cc, and my runtime improves dramatically, dropping my 100ms runtime to about 700us. This is game changing for me, since the 100ms runtime makes protovalidate-cc unusable in my real-time robotics application. 700us is no sweat.

The change is so straightforward that it feels like an explicit choice to not do this, and lean heavily into CEL, even for simple numerical tests, for the sake of simplicity and uniformity. Is this the case? Would this project welcome patches that move operations out of CEL and into native tests? Either way, thank you for sharing this great project.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugSomething isn't working

    Type

    No type

    Fields

    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