nazeka icon indicating copy to clipboard operation
nazeka copied to clipboard

Large(?) document lag

Open ninep9up opened this issue 5 years ago • 1 comments

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?

ninep9up avatar Oct 28 '19 12:10 ninep9up

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.

wareya avatar Oct 28 '19 12:10 wareya