Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[longman] certain lookup take long time #19

Open
emacsbliss opened this issue Dec 11, 2021 · 3 comments
Open

[longman] certain lookup take long time #19

emacsbliss opened this issue Dec 11, 2021 · 3 comments

Comments

@emacsbliss
Copy link

for some reason certain words takes long time to get the result displayed in buffer..

few examples:

  • successful
  • personally
@condy0919
Copy link
Owner

Does

curl "https://www.ldoceonline.com/dictionary/successful"

have the same issue?

Since fanyi.el uses url-retrieve, it may be suffered from the network jitter

@emacsbliss
Copy link
Author

curl seems to return pretty quickly.. wondering would it be rendering issue?

@condy0919
Copy link
Owner

condy0919 commented Dec 11, 2021

(setq longman-ins (clone fanyi-longman-provider))
(oset longman-ins :word "successful")
(fanyi--spawn longman-ins)

;; Wait until *fanyi* buffer has a longman section which means longman-ins has parsed the result.
;;
;; benchmark the render function.
(benchmark-run 10 (fanyi-render longman-ins))
;;=> (0.150839075 0 0.0)

It costs 0.015s per render on my machine.

PS: switch to *fanyi* buffer will see 11 sections of longman dict. one is created by fanyi--spawn.

@condy0919 condy0919 mentioned this issue Jun 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants