Opened 5 years ago

Closed 5 years ago

#17456 closed enhancement (fixed)

Speedup TIDES interface

Reported by: mmarco Owned by:
Priority: major Milestone: sage-6.5
Component: interfaces Keywords: TIDES,
Cc: vbraun, jdemeyer, vdelecroix, iMark Merged in:
Authors: Miguel Marco Reviewers: Marcos Rodriguez
Report Upstream: N/A Work issues:
Branch: 3ae6f7c (Commits) Commit: 3ae6f7cb84c34f323c15e7ba423231aead5876bf
Dependencies: Stopgaps:

Description

Right now the interface to TIDES does a lot of symbolic expresion comparisons, which is very slow. This patch changes those comparisons to the corresponding strings, which is much faster.

As an example, the following problem:

sage: from sage.interfaces.tides import genfiles_mintides
sage: f(x,t) = [sin(x*t)+cos(x)/sqrt(1+x^2+log(x)-5*exp(x^2+1))]
sage: %time genfiles_mintides('/dev/null', '/dev/null', f, [1], 0, 10, 10, output='/dev/null')
CPU times: user 9.31 s, sys: 46 ms, total: 9.35 s
Wall time: 9.32 s

With the patch is reduced to:

sage: from sage.interfaces.tides import genfiles_mintides
sage: f(x,t) = [sin(x*t)+cos(x)/sqrt(1+x^2+log(x)-5*exp(x^2+1))]
sage: %time genfiles_mintides('/dev/null', '/dev/null', f, [1], 0, 10, 10, output='/dev/null')
CPU times: user 838 ms, sys: 24 ms, total: 862 ms
Wall time: 854 ms

Change History (5)

comment:1 Changed 5 years ago by mmarco

  • Branch set to u/mmarco/ticket/17456
  • Created changed from 12/07/14 18:14:31 to 12/07/14 18:14:31
  • Modified changed from 12/07/14 18:14:31 to 12/07/14 18:14:31

comment:2 Changed 5 years ago by mmarco

  • Commit set to 3ae6f7cb84c34f323c15e7ba423231aead5876bf
  • Summary changed from Sppedup TIDES interface to Speedup TIDES interface

New commits:

3ae6f7ccomparison by strings in tides interface

comment:3 Changed 5 years ago by mmarco

  • Status changed from new to needs_review

comment:4 Changed 5 years ago by iMark

  • Reviewers set to Marcos Rodriguez
  • Status changed from needs_review to positive_review

Looks good to me. I tested and the code in a quite complex example is the same

comment:5 Changed 5 years ago by vbraun

  • Branch changed from u/mmarco/ticket/17456 to 3ae6f7cb84c34f323c15e7ba423231aead5876bf
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.