LNReader / lnreader-plugins

Repository to host source related issues, and requests for LNReader
MIT License
101 stars 51 forks source link

lightnovel #956

Closed Rider21 closed 1 month ago

Rider21 commented 1 month ago

Added cpunovel plugin (closes #935) Added Ippotranslations plugin (closes #873) Plugin ellotl moved to lightnovelwp Fixed Ranobelib plugin (closes #960)

Batorian commented 1 month ago

I wrote a separate Plugin for ElloTL in order to make it work with htmlparser2. Multisrc would use cheerio.

Rider21 commented 1 month ago

I think in react-native they will be the same in terms of execution time. But I will rewrite lightnovelwp to htmlparser2 later.

nyagami commented 1 month ago

I think in react-native they will be the same in terms of execution time. But I will rewrite lightnovelwp to htmlparser2 later.

Nah, Cheerio keep whole DOM tree in memory which helps you to querySelector, and building that tree (load) consumes much resource which lead to lag in update library and global search

Rider21 commented 1 month ago

Hmm, then it's probably better to use native regex, match, substr, etc. It will be much faster as you will only search for what you need.

nyagami commented 1 month ago

Not really, With htmlparser2, Time complexity is O(nk) where k is the number of switch case/if else statements, therefore you can consider as O(n). Meanwhile with regex, it takes O(nq) where q is the number of queries. Even worse if you use some bad regex