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.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/598282

Title:
  command-not-found slow for its task

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/command-not-found/+bug/598282/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to