MyFaces Core
  1. MyFaces Core
  2. MYFACES-3563 Improvements in State Saving Algorithm
  3. MYFACES-3568

[perf] use viewId hashCode() instead full viewId on server side state saving SerializedViewKey


    • Type: Sub-task Sub-task
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.0.15, 2.1.9
    • Component/s: JSR-314
    • Labels:


      In SerializedViewKey, the current code uses a counter and the full viewId as key to retrieve or save the state into session.

      But store the full viewId is not really necessary. The counter itself gives uniqueness inside the session, and the viewId is just a way to check if the state to restore is the right one. In other words, given the probability of found two valid viewIds in an application with the same hashCode is astronomical and the fact that there is a counter that identify in an unique way a view state session token, it is reasonable to store into the state only the hashCode, and when the view is restored compare the viewId hashCode with the stored one into the state.

      This change will reduce the size required by SerializedViewKey.


        Leonardo Uribe made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Leonardo Uribe made changes -
        Field Original Value New Value
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 2.0.15 [ 12321753 ]
        Fix Version/s 2.1.9 [ 12321755 ]
        Resolution Fixed [ 1 ]
        Leonardo Uribe created issue -


          • Assignee:
            Leonardo Uribe
            Leonardo Uribe
          • Votes:
            0 Vote for this issue
            1 Start watching this issue


            • Created: