I hate to cross-post, so I'll post a link.
the inefficiency of get_list_languages() was bothering me seriously, so I fixed it do create a cached copy in dataroot/cache, and use that instead of recreating it every time.
More details here:
http://moodle.org/mod/forum/discuss.php?d=21688
General developer forum
Moodle performance profiling and memory footprint
This discussion has been locked so you can no longer reply to it.