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 #297

Closed Totto16 closed 1 month ago

Totto16 commented 1 month ago

Description

Fixes #296

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.

Type of change

This also adds tests πŸŽ‰

Note the new tests fail without this patch, so they can catch errors πŸŽ‰

Checklist