carbon-language / carbon-lang

Carbon Language's main repository: documents, design, implementation, and related tools. (NOTE: Carbon Language is experimental; see README)
https://github.com/carbon-language/carbon-lang/blob/trunk/README.md
Other
32.31k stars 1.48k forks source link

Reduce the new hashtable test times. #4047

Closed chandlerc closed 2 weeks ago

chandlerc commented 3 weeks ago

While it was convenient once to have an immediate check while inserting, it is indeed far too quadratic. The test was taking 30-60 seconds for me. =[ So most of the fix here is just to stop doing the check on every insertion for all previous elements.

There were a few other somewhat slow steps, and I tried to pull those back as well. I don't think we lose any utility here. Now everything runs nice and quickly. =]

chandlerc commented 2 weeks ago

I've unstacked this and am merging. It was going to have lots of merge conflicts with the growth API anyways, and this way we can get to faster test times sooner.