Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unescaping works not as intended and is slow #297

Merged
merged 11 commits into from
Jun 4, 2024

Conversation

Totto16
Copy link
Collaborator

@Totto16 Totto16 commented Jun 4, 2024

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

  • Bug fix (non-breaking change which fixes an issue)

This also adds tests 🎉

Note the new tests fail without this patch, so they can catch errors 🎉

Checklist

  • My code follows the style guidelines of this project
  • My commits follow the commit standards of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have checked my code and corrected any misspellings

Totto16 added 2 commits June 4, 2024 19:14
…ut using expensive C API calls

- db factor out the init parameters to be a path, so that we can write tests in the future
@Totto16 Totto16 linked an issue Jun 4, 2024 that may be closed by this pull request
@Totto16 Totto16 added bug Something isn't working Priority High Priority High labels Jun 4, 2024
@Totto16 Totto16 requested a review from oae June 4, 2024 21:55
@Totto16 Totto16 changed the title 296 unescaping works not as intended and is slow Unescaping works not as intended and is slow Jun 4, 2024
@Totto16 Totto16 merged commit b8cec16 into master Jun 4, 2024
1 check passed
@Totto16 Totto16 deleted the 296-unescaping-works-not-as-intended-and-is-slow branch June 4, 2024 22:42
Totto16 added a commit that referenced this pull request Jun 4, 2024
- bug #296
- this is a backport of PR #297
@Totto16 Totto16 mentioned this pull request Jun 4, 2024
8 tasks
Totto16 added a commit that referenced this pull request Jun 4, 2024
- this is a backport of PR #297
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Priority High Priority High
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unescaping works not as intended and is slow
2 participants