feat: stop using regex pattern to escape single quota#275
Merged
sheyanjie-qq merged 2 commits intotaosdata:mainfrom Aug 22, 2025
Merged
feat: stop using regex pattern to escape single quota#275sheyanjie-qq merged 2 commits intotaosdata:mainfrom
sheyanjie-qq merged 2 commits intotaosdata:mainfrom
Conversation
Contributor
Author
|
A simple performance test sample code: int testSize = 10000;
List<String> payloadPool = new ArrayList<>(testSize);
for (int i = 0; i < testSize; i++) {
payloadPool.add(RandomUtil.randomString(1024));
}
Stopwatch stopwatch = Stopwatch.createStarted();
for (int i = 0; i < testSize; i++) {
escapeSingleQuota(payloadPool.get(i));
}
System.out.println(stopwatch.elapsed());Test case: Winodws x64 OpenJDK17 platform, 10000 elemets. With 1000000 elements, it takes PT1.0449361S to complete. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #275 +/- ##
============================================
- Coverage 71.98% 71.60% -0.38%
+ Complexity 3658 3652 -6
============================================
Files 193 196 +3
Lines 12371 12418 +47
Branches 1652 1656 +4
============================================
- Hits 8905 8892 -13
- Misses 2432 2477 +45
- Partials 1034 1049 +15
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
sheyanjie-qq
approved these changes
Aug 22, 2025
sheyanjie-qq
added a commit
that referenced
this pull request
Dec 9, 2025
* perf: improve native query performance (#274) * chore: update changelog (#276) * feat: stop using regex pattern to escape single quota (#275) * feat: stop using regex pattern to escape single quota * feat: escape single quota unit test --------- Co-authored-by: dywangbh <dywangbh@chint.com> * feat: supports delete meta subscription (#277) * feat: supports delete meta subscription * chore: improve meta enum implementation * perf: improve writing efficiency in efficient writing mode by serializing data with a separate thread (#278) * feat: JDBC URL supports multiple endpoints (#279) * chore: improve tests * add loadbalance tests * feat: stmt supports reconnection (#280) * chore: improve tests * add loadbalance tests * perf: improve isValid performace (#281) * chore: improve tests * feat: use cache to improve isValid perf * chore: update deploy pom (#282) * chore: update change log (#283) * feat: improve stmt setObject and loadbalance (#284) * feat: improve stmt setObject and loadbalance * Update src/main/java/com/taosdata/jdbc/ws/AbsWSPreparedStatement.java Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> --------- Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> * chore: update changelog (#285) * fix: load properties issue in windows (#289) * fix: WebSocket statement timeout setting resets transport's timeout (#290) * fix: WebSocket statement timeout setting resets transport's timeout Closes TD-38565 * --amend * fix: fix getTables need identifier quote string bug. (#292) Closes TD-38643. * feat: Optimize the load balancing logic to achieve rebalancing after node failure recovery. (#291) * fix: load properties issue in windows * feat: supports rebalance when node down * fix: WebSocket statement timeout setting resets transport's timeout Closes TD-38565 * --amend * --amend * chore: fix unit test issues * chore: add unit tests * fix: websocket reconnect null point error (#296) Closes: TD-38690 * fix: fix sonar error and security issues (#295) * fix: load properties issue in windows * feat: supports rebalance when node down * fix: WebSocket statement timeout setting resets transport's timeout Closes TD-38565 * --amend * --amend * chore: fix unit test issues * chore: add unit tests * chore: fix sonar error and security issues Closes 6482039483 * chore: add unit tests --------- Co-authored-by: Oneby <44369297+oneby-wang@users.noreply.github.com> Co-authored-by: dywangbh <dywangbh@chint.com> Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Using regex pattern to escape single quota has a big performance problem. I followed the previous unit tests, and then refactored Utils.escapeSingleQuota() method, and then added some more unit tests.
Checklist
Please check the items in the checklist if applicable.