The pathfinding script suggested by MrGuest uses a point of visibility graph which isn't reasonable for most strategy games (but for other kind of games, of course). You rather want to use a dense pathfinding grid (basically a two-dimensional matrix).

There are many ways to improve the performance of a pathfinding algorithm:

- In the first place the source code should be of good quality. Try to avoid obvious shortcomings.
- Using appropriate data structures for e.g. the open and the closed list can also improve the speed.
- Use a pathfinding manager that spreads the pathfinding computations over several frames (or something like that).
- Use hierarchical pathfinding for large pathfinding graphs.
- Share computed paths among units.
- Flood fill approach suggested by Damocles: http://www.opserver.de/ubb7/ubbthreads.php?ubb=showflat&Number=313826#Post313826

If your game world is dynamic (ability to construct and destroy buildings, destructable environment and so on) precomputed paths won't help that much, I guess. Perhaps you could cache widely used paths instead, e.g. a path between the enemy's base and the player's base. Depending on the game, you could also experiment with ACO. This might give interesting results!