ZhangYu0123 opened a new pull request, #18496:
URL: https://github.com/apache/doris/pull/18496

   # Proposed changes
   Use SIMD stringsearcher and SIMD memcmp optimze split_by_string and 
substring_index function.
   - split_by_string has 120%~540% up
   - substring_index has 22%~46% up
   
   (1) split_by_string
   | needle | before | after |  up | comment |
   |--------|--------| --------|--------|--------|
   | needle size 6, constant | 
![image](https://user-images.githubusercontent.com/67053339/230769281-12a4f773-37d5-4896-975f-6ceb3fa9141c.png)
 | 
![image](https://user-images.githubusercontent.com/67053339/230769690-4951f5d0-8825-4b9f-bd3f-12c9ee1978b1.png)
 |  540% | use StringSearcher  |
   | needle size 6, vector | 
![image](https://user-images.githubusercontent.com/67053339/230769318-f700dda0-be3d-45e4-a179-28e2eabc0183.png)
 | 
![image](https://user-images.githubusercontent.com/67053339/230769887-ef2e6cc3-f6b4-4fae-a1b1-8f2b4b5718c0.png)
 | 120% | use SIMD memcmp |
   |  needle size 1, constant | 
![image](https://user-images.githubusercontent.com/67053339/230769845-1bf20350-a7e2-49aa-8dbc-296c61348c99.png)
 | 
![image](https://user-images.githubusercontent.com/67053339/230769905-063f2490-2f48-4495-b8b7-75862fa3ab3a.png)
 | 200% | use StringSearcher  |
   |  needle size 1, vector |  cell | cell  | cell  | use SIMD memcmp  |
   
   
   (2) substring_index
   1. needle vector params are not supported.
   2. in needle size 1 case, memchr is 6% faster than SIMD stringsearcher.  
when needle size greater than 1, stringsearcher is better than memmem.
   
   | needle | before | after |  up | comment |
   |--------|--------| --------|--------|--------|
   | needle size 6, constant | 
![image](https://user-images.githubusercontent.com/67053339/230770643-bc04da6f-67f7-45b0-850c-05126fcd0a09.png))
 | 
![image](https://user-images.githubusercontent.com/67053339/230770587-93e985c9-40c2-4984-95ab-b5529c4b2eb4.png)
 |  46% |  use StringSearcher  |
   |  needle size 2, constant | 
   
![image](https://user-images.githubusercontent.com/67053339/230770798-9e207d27-89b5-4857-aea4-103daa290d13.png)
    | 
![image](https://user-images.githubusercontent.com/67053339/230770754-9b0ef88f-8899-41c3-8978-2fc0c4d73bfd.png)
 | 22% | use StringSearcher  |
   
   
   
   Issue Number: close #xxx
   
   ## Problem summary
   
   Describe your changes.
   
   ## Checklist(Required)
   
   * [ ] Does it affect the original behavior
   * [ ] Has unit tests been added
   * [ ] Has document been added or modified
   * [ ] Does it need to update dependencies
   * [ ] Is this PR support rollback (If NO, please explain WHY)
   
   ## Further comments
   
   If this is a relatively large or complex change, kick off the discussion at 
[[email protected]](mailto:[email protected]) by explaining why you 
chose the solution you did and what alternatives you considered, etc...
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to