Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvements and simplification in corpus' handling randomisation code #22

Closed
wants to merge 1 commit into from
Commits on Dec 31, 2019
  1. Improvements and simplification in corpus' handling randomisation code

    jvoisin committed Dec 31, 2019
    - Remove useless casts to bool
    - Use something faster than random.randint: this cuts in half the time spent
      in the random.py file, without raising anything else
    - use random.choice where possible, instead of `mylist[_rand(len(mylist))]`
    - Add some comments explaining the if…if…else structure, to prevent
      future refactoring from transforming them into an if…elif…else
    
    On a local fuzzer, with 10000 iterations, this decrease the amount of time
    spent in corpus' mutate function from ~0.2 seconds to ~0.1 seconds, for a total
    run time of ~9 seconds, which seems to not be a lot, but since 8.60s is spent
    in connection.py's poll function waiting for the fuzzer, it's a worthy
    optimization.
You can’t perform that action at this time.