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

Faster distance computation #83

Merged
merged 1 commit into from
Jan 29, 2021
Merged

Conversation

Liblor
Copy link

@Liblor Liblor commented Jan 18, 2021

Hi

I am using parts of AflGo for my master thesis. Since the distance computation was a bit slow for my use-case I rewrote it in C++. This version acts as drop-in replacement for distance.py. Furthermore, I replaced the genDistance.sh with a python script which calls the distance computation in parallel.
These modifications result in a significant speed up!

Summary of optimizations:

  • Use C++ instead of python
  • Use BFS instead of Dijkstra as graph is unweighted
  • Parallelize computation

- Use C++ instead of python
- Use BFS instead of Dijkstra as graph is unweighted
- Parallelize computation
Copy link
Collaborator

@mboehme mboehme left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution @Liblor! LGTM.
@strongcourage Can you also have a quick look?

@mboehme mboehme merged commit 5ef0827 into aflgo:master Jan 29, 2021
@mboehme
Copy link
Collaborator

mboehme commented Jan 29, 2021

Thanks again @Liblor! As spoken separately, let us know if you have some updates/experience on porting AFLGo to LLVM 11 (or higher).

@Liblor
Copy link
Author

Liblor commented Feb 1, 2021

Addendum:

As promised @strongcourage, I timed the distance computation of xmllint and
cxxfilt.

genDistance.sh gen_distance_fast.py rough speed up
xmllint 85min 39.8s 28.6s ~180x
cxxfilt 17min 48.2s 15.1s ~71x

Machine: i7-10700 CPU @ 2.90GHz, RAM 32GB (Dell OptiPlex 7080)
Distro: Ubuntu 18.04.5 LTS

Note: This is not a scientific measurement. I ran genDistance.sh only
once and gen_distance_fast.py three times (reported median). Also I didn't
disable intel turbo boost and ignored other best practices. However, I didn't
do any other work on the machine during the computation. This should only
act as an approximation to see the rough magnitude of the improvement :)

@strongcourage
Copy link
Collaborator

Hi @Liblor,
Thank you for this table, it looks great :)

@mboehme
Copy link
Collaborator

mboehme commented Feb 1, 2021

Nice work! Thanks again @Liblor.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants