jakartaee / jakartaee/faces

Specify that fast iteration (with indices) is possible

Open
#1,003 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Priority: Minor Type: Improvement
Dominant language
Java
Stars
127
Forks
59
Avg merge
23h
Merged PRs (30d)
7

Description

Performance related problem:

Both Mojarra and MyFaces use iterator() for iteration over children. That is very slow if view is big and contains thousands of components.

Specify:
1) Specify : UIComponent.getChildren() is type of java.util.RandomAccess
2) Specify new UIComponent.getFacets(): List (java.util.RandomAccess) for fast iteration over facets

1) is very easy because mojarra and myfaces use ArrayList for children (so does trinidad)

I think this is not implementation detail, because custom renderkits must know that fast iteration is possible

See:
[https://issues.apache.org/jira/browse/MYFACES-3130](https://issues.apache.org/jira/browse/MYFACES-3130)
[http://www.mail-archive.com/dev@myfaces.apache.org/msg52979.html](http://www.mail-archive.com/dev@myfaces.apache.org/msg52979.html)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the UIComponent API and the existing children and facets implementations, then review MYFACES-3130 and the linked mailing-list discussion for compatibility and design context. Verify how Mojarra, MyFaces, and Trinidad currently expose and iterate these collections, and use the project’s existing API tests to confirm the specified fast-iteration contract.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api, performance
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.