oae / gnome-shell-pano

Next-gen Clipboard Manager for Gnome Shell
https://extensions.gnome.org/extension/5278/pano/
GNU General Public License v2.0
978 stars 52 forks source link

Unescaping works not as intended and is slow #296

Closed Totto16 closed 1 month ago

Totto16 commented 1 month ago

Description

After I made #266 and tested it, it passed all manual tests and also did perform normally. But after using it locally on real data it performs poorly, taking seconds to unescape everything in my history (I have a 500 entries history 😓 )

After investigating this issues, and reading into the source code of default_unescape_string I found out, that they unescape '' (two single quotes) to ' and tested the input of '' and copying that entry, it was unescaped to ' which is incorrect.

Also the performance problem lies into calling C functions is rather expensive, and doing it for ~500 entries takes a few seconds, even if the c function is fast, the transition costs to much in this case.

The best solution is to rewrite the exact needs of the unescape behavior ourselves in js, even if I wonder why this problem exists in the first case in gda.

I am working on fixing this 👍🏼