| 5 | Before |

| 6 | {{{ |

| 7 | sage: g=graphs.PaleyGraph(1009) |

| 8 | sage: %time g.complement() |

| 9 | CPU times: user 2.14 s, sys: 64 ms, total: 2.2 s |

| 10 | Wall time: 2.14 s |

| 11 | complement(Paley graph with parameter 1009): Graph on 1009 vertices |

| 12 | }}} |

| 13 | |

| 14 | After |

| 15 | {{{ |

| 16 | sage: %time g.complement() |

| 17 | CPU times: user 164 ms, sys: 12 ms, total: 176 ms |

| 18 | Wall time: 160 ms |

| 19 | complement(Paley graph with parameter 1009): Graph on 1009 vertices |

| 20 | }}} |

| 21 | |

| 22 | In dense_graph.pyx, this branch mostly does the following: |

| 23 | - Turn 'radix' and radix_mod_mask' into module variables (they do not depend on the instance) |

| 24 | - remove 'radix_div_shift'. This variable is meant to turn a division by radix into a shift. As radix is determined at compile-time, the compiler already does this simplification (for free) |

| 25 | - Turn multiplication/division by powers of two from 'shift' to multiplication/division. The code is easier to read, and the compiled binary is the same anyway. |

| 26 | - Uses calloc (instead of malloc) to initialize memory. This is slightly wasteful, and the code is much cleaner as a result. |

| 27 | |