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

fix #16434, superlinear compiler run time on large functions #16634

Merged
merged 1 commit into from
May 29, 2016

Conversation

JeffBezanson
Copy link
Member

Fixes this case completely, and seems to make the compiler a bit faster in general. Also helps #6685. Here are timings for these two issues on 0.4, master, and this branch:

0.4:
#16434:
     "n"    "t"         "t/n"        "t/n^2"  
   10.0    0.00164358  0.000164358  1.64358e-5
  100.0    0.00879924  8.79924e-5   8.79924e-7
 1000.0    0.473102    0.000473102  4.73102e-7
 2000.0    1.52983     0.000764916  3.82458e-7
 5000.0   11.0141      0.00220281   4.40563e-7
#6685:
  0.098373 seconds (287.72 k allocations: 9.650 MB)
  7.901539 seconds (23.98 M allocations: 1013.564 MB, 5.49% gc time)

master:
#16434:
     "n"   "t"         "t/n"        "t/n^2"  
   10.0   0.00416715  0.000416715  4.16715e-5
  100.0   0.0140538   0.000140538  1.40538e-6
 1000.0   0.508589    0.000508589  5.08589e-7
 2000.0   1.47        0.000734999  3.675e-7  
 5000.0   8.78618     0.00175724   3.51447e-7
#6685:
  0.115415 seconds (152.93 k allocations: 6.113 MB)
  6.339654 seconds (21.08 M allocations: 456.994 MB, 2.68% gc time)

this branch:
#16434:
     "n"   "t"         "t/n"        "t/n^2"  
   10.0   0.00379853  0.000379853  3.79853e-5
  100.0   0.0104883   0.000104883  1.04883e-6
 1000.0   0.139594    0.000139594  1.39594e-7
 2000.0   0.300802    0.000150401  7.52006e-8
 5000.0   0.723599    0.00014472   2.8944e-8 
#6685:
  0.109920 seconds (152.26 k allocations: 6.093 MB)
  5.517983 seconds (16.24 M allocations: 325.356 MB, 3.00% gc time)

improves the algorithm in `type_annotate!` to look only at uses
of variables instead of (all variables)*(all statements)
@JeffBezanson JeffBezanson merged commit b88be59 into master May 29, 2016
@vtjnash vtjnash deleted the jb/fix16434 branch May 29, 2016 03:16
@toivoh
Copy link
Contributor

toivoh commented May 29, 2016

Thanks!

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