Github user SlavikBaranov commented on the pull request:

    https://github.com/apache/spark/pull/6763#issuecomment-111964817
  
    @zsxwing are you talking about changing condition in `rehashIfNeeded` to 
something like this:
    
        if (_size > _growThreshold && _capacity < MAX_CAPACITY) {
            rehash(k, allocateFunc, moveFunc)
        }
    
    Well... it's possible (and it's possible to guard against infinite loop), 
but as the load increases, both put and lookup time become O(n). I mean, in the 
worst case scenario, adding the last item takes 2^30 iterations & further 
lookup of that item takes the same number of iterations.
    
    Is my understanding correct or I'm missing something?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to