Skip to content

optimize vector slicing #40482

@user202729

Description

@user202729

Problem Description

R = vector(GF(2), 32, [1,1,1,1,0,0,0,0,1,0,1,0,1,0,1,0,1,1,1,
					   1,0,0,0,0,1,0,1,0,1,0,1,0])
for i in range(100000): ignore = R[0:16]

A lot of time is spent on running create_key_and_extra_arg, lookup the parent object, constructing instances of IntegerMod, etc.

Proposed Solution

we could do something similar to copy_from_unsafe or new_matrix method in matrix.

context: I was looking into why DES is so slow (#40475), and it looks like the slicing/vector operations takes most of the time.

Alternatives Considered

Additional Information

No response

Is there an existing issue for this?

  • I have searched the existing issues for a bug report that matches the one I want to file, without success.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions