Comment 2 for bug 598282

Revision history for this message
Zygmunt Krynicki (zyga) wrote :

Feel free to help me out. The only issue why this app is slow is python startup time. A rewrite in C would make it much more responsive. NB: The app is _fast_ but not _responsive_.

More than a year ago I did an experiment with c-n-f running as a daemon with a trimmed-down C program talking to it over dbus. The initial response was roughly identical to what c-n-f does today. Each subsequent response was instant (on a very slow atom laptop with spinning disk). I did not finish that design but I think the idea is sound.

There are three things taking time in c-n-f:

1) The start up time of the environment (currently the only really slow thing)
2) The query, this is actually very fast using binary database optimized for lookups. It actually answers 10s or even 100s queries each time you miss-type a command as it searches for similar command to offer typo suggestions. I don't see the need to optimize this much but one possible solution would be to add a cache for things that people often miss-type to save on the "spellchecker" lookups.
3) The time it takes to format and print the message, this is very fast and I don't see the need to change that.