Cython
system:sage

<p>A function to count the number of integer partitions with parts in a given set.</p>

{{{id=14|
def buying(coins, total):
  vlist = [ [0] * len(coins) for _ in range(total + 1) ]
  for i in range(total + 1):
    for j, coin in enumerate(coins):
      if j == 0:
        if i % coin == 0:
          vlist[i][j] = 1
      else:
        k = 0
        while i - k >= 0:
          vlist[i][j] += vlist[i - k][j - 1]
          k += coin
  return vlist[total][len(coins)  - 1]
///
}}}

<p>Let's see how long it takes to find the number of partitions of 1000 into odd parts.</p>

{{{id=15|
%time
buying([1,3..750], 750)
///
4923988648388880384
CPU time: 7.87 s,  Wall time: 8.00 s
}}}

<p>Make two changes:</p>

{{{id=16|
%cython
def cybuying(coins, total):
  cdef int i, j, k, coin
  vlist = [ [0] * len(coins) for _ in range(total + 1) ]
  for i in range(total + 1):
    for j, coin in enumerate(coins):
      if j == 0:
        if i % coin == 0:
          vlist[i][j] = 1
      else:
        k = 0
        while i - k >= 0:
          vlist[i][j] += vlist[i - k][j - 1]
          k += coin
  return vlist[total][len(coins)  - 1]
///
}}}

<p>Surely two tiny changes in some Python code can't make it much faster...</p>

{{{id=17|
%time
cybuying([1,3..750], 750)
///
4923988648388880384L
CPU time: 0.29 s,  Wall time: 0.29 s
}}}

{{{id=18|
8.00/.29
///
27.5862068965517
}}}

{{{id=19|

///
}}}