Skip to content

Can we use less memory even we need to construct tons of combination? #964

@mika-cn

Description

@mika-cn

I was testing css-selector-generator with an element that has 29 attributes, and some of them have long values, such as an URL. I used the default getCssSelector(element) without pass in an option. It ate up almost 1GB, which is so crazy. I did try to find out what happened, and notice that there's tons of combination of different selector parts.

Can we just store these different values in one place and just generate combinations use indexes or some sort of IDs. So we don't need to copy the same value so many times?

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions