Skip to content

Check for possible performances issues #5

Description

@LGala

When a lot of visibleChars are present, something like this may be particularly slow, because of a lot of list creations

const getInitialPlaceholders = (selectedChar: string): Placeholder[] => {
	const tokens = getVisibleChars();

	const jumpableChars: Char[] = tokens
		.map((char, absoluteIndex) => ({ char, absoluteIndex }))
		.filter(char => isCharJumpable(char, tokens, selectedChar));

	const placeholderGenerator = new IncrementalStringGenerator(jumpableChars.length);

	return jumpableChars.map(char => getPlaceholder(char, placeholderGenerator));
};

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions