GMP logo

Relative Speed of GMP Low-Level Functions updated for GMP 4.1


These diagrams show the approximate performance for the most important low-level routines of GMP. These routines are the work-horses of GMP, and for many applications nearly 100% of the run time is spent therein.

For most CPU architectures, these routines are written in hand-crafted assembly language.

These tables are normalized so that the fastest CPU gets 100. Other CPU's values represent a percentage of the fastest CPU. Values are at the indicated CPU frequencies, adjust them accordingly for other CPU frequencies. First-level cache hit is assumed.

Grey bars indicate one of two things, either that the numbers are not measured but instead are based on vendor-supplied documentation, or that new code is being conceived that is believed to give the indicated performance once it is implemented.

Pink/lightgrey indicate that the performance is higher for certain operand values. The base performance is indicated using red/darkgrey.

Most GMP crunching depends most heavily on the speed of mpn_addmul_1. For machines where mpn_addmul_N is implemented, for some greater value of N, that becomes a more important routine than mpn_addmul_1. That is because multiplication, division, modulo, gcd, etc, all boil down to calls to mpn_addmul_1 or mpn_addmul_N.

CPU manufacturers! You may want to improve the figures for your CPU. Talk to gmp-devel@gmplib.org. This list reaches GMP developers on the Net and on commercial companies, some of which may want to help you for a fee.

Some comments about how certain processors perform


mpn_addmul_N performance

mpn_addmul_1 and mpn_submul_1 performance

mpn_mul_1 performance

mpn_add_n and mpn_sub_n performance

mpn_lshift and mpn_rshift performance


Please send comments about this page to webmaster@gmplib.org
Copyright 2000-2003 Free Software Foundation
Verbatim copying and distribution of this entire article is permitted in any medium, provided this notice is preserved.