Implement UTF16 to UTF8 length with replacement for rvv architecture - #890
Implement UTF16 to UTF8 length with replacement for rvv architecture#890sleepingeight wants to merge 2 commits into
Conversation
|
Although the idea seemed simple, I've found that the function is performing poorly in benchmarks. On my machine Apple Mac M1 Pro (ARM), the benchmarks are as follows - I see a 25% performance decrease. Whereas the rvv is performing in the following way - Here, I've found a 75% decrease. Please suggest ways to improve the performance of this procedure. |
|
The scalar code is performing way better - Is this regression due to inefficient emulation? |
|
@sleepingeight I assume you are running this through an emulator ? If so, we can't really tell much about your benchmark results. I would be happy to merge this in any case... we can always revise the implementation given actual hardware we care about. |
|
Hi @lemire, could you please suggest next steps to take this PR forward. |
|
@sleepingeight I am game to merge your PR if you recommend it. In any case, the whole RVV thing is experimental as far as performance goes. |
Short title (summary):
Implement UTF16 to UTF8 length with replacement for rvv architecture
Description
Related to #853.
The function is implemented in the following manner, invalid surrogates are found by right shifting and left shifting the data vector and checking whether high surrogate is followed by low surrogate, this count is added to the original count from
utf8_to_utf16_lengthto get the total length.Type of change
Checklist before submitting