wareya / nazeka

Nazeka is a rikai replacement
https://addons.mozilla.org/en-US/firefox/addon/nazeka/
49 stars 8 forks source link

Large(?) document lag #38

Open ninep9up opened 4 years ago

ninep9up commented 4 years ago

I've converted Japanese frequency dict to 5mb HTML just to use with nazeka. Here's the link to it: https://yadi.sk/d/rdkdanephAZQKA (The font in this is ackaisyo, you can get it from https://github.com/Alex1166/marusha/blob/master/assets/fonts/ACKaisyo.ttf)

The thing is it becomes unworkably laggy when hovering.

Is there any way to fix this?

wareya commented 4 years ago

As far as I know, his is basically a browser performance problem. I'm not sure which aspect of what nazeka is doing is making it be so sluggish, but nazeka isn't doing anything weird, just asking what text is under the cursor then jumping back and forth between nearby elements to collect text. Browsers are bad at handling documents this big in general (it's bigger than a novel compilation I have), so it's not surprising.

You can improve your specific instance of this problem a little bit by using <div> elements instead of separating <span> elements with <br>s, though it will still be very laggy. Really though, web browsers are very inefficient at displaying this much content once, you should probably load the dictionary into a javascript object and have a search bar to dynamically populate the page with instead.