cute-jumper / fcitx.el

Better fcitx integration for Emacs.
129 stars 16 forks source link

Call fcitx-remote directly, don't through shell #7

Closed xuchunyang closed 8 years ago

xuchunyang commented 8 years ago

Because it is not necessary, e.g., we don't need pipe output between commands, and it can improve performance:

;; Original:
(measure-time (fcitx--active-p))
    ⇒ "0.033646"

;; This version:
(measure-time (fcitx--active-p))
    ⇒ "0.027410"

(defmacro measure-time (&rest body)
  "Measure the time it takes to evaluate BODY."
  `(let ((time (current-time)))
     ,@body
     (message "%.06f" (float-time (time-since time)))))
cute-jumper commented 8 years ago

Thanks! Seems calling as the shell command causes many issues.