Questions about optimizing code for faster results, or how to do faster computations.

learn more… | top users | synonyms

9
votes
3answers
365 views

Why is AstronomicalData so slow?

I'm having trouble getting some pretty simple functions using AstronomicalData to perform at anywhere near the speed I need them to. For example, I have many ...
3
votes
1answer
1k views

Improving NDSolve speed for heavily stiff problems

Having looked around the intergoogles and Mathematica.SE, I thought I'd pose a question with a minimum working example. Here is the situation I am trying to improve: I am solving a 4th order non ...
4
votes
2answers
289 views

How to speed up drawing a tangent plane?

I have this code to produce an interactive visualization of a tangent plane to a function: ...
20
votes
2answers
935 views

How to quickly calculate intersections of filled curves?

I am trying to quickly calculate the intersection of polygons with more than 6,000 points. A compiled solution would be preferable. Here is one example of the problem: ...
10
votes
1answer
624 views

Is there a simple example using OpenCLLink that shows performance advantages?

OpenCLLink allows Mathematica to use the OpenCL parallel computing language. I have done some tests on simple examples, but so far, the CPU regularly outperforms ...
2
votes
1answer
207 views

Why is LogLogPlot[] slower than Plot[]?

I notice that LogLogPlot runs quite bit more slowly than ordinary Plot. For example, consider the following two blocks of code ...
7
votes
3answers
238 views

How can I efficiently check if a graph is unit distance?

A unit distance graph is a graph that is embeddable in the plane so that every edge has length 1. ...
23
votes
4answers
1k views

What is the fastest way to count square-free words?

Background A word is a string of letters in an alphabet. A square-free word has no adjacent repeating substring. For example, (in the ternary alphabet of {0,1,2}) the words 00, 012121, and 0212012021 ...