question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Implement SWAR indexOf byte search

See original GitHub issue

Currently Netty uses an expensive (GC-wise too) ByteBufUtil::indexOf implementation based on ByteProcessor.IndexOfProcessor to save bound-checks to happen: this could be changed into what @richardstartin has implemented on https://richardstartin.github.io/posts/finding-bytes.

Same could be applied to ByteBuf::indexOf that’s not using ByteBufUtil::indexOf(!!!) @normanmaurer Any idea why?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
franz1981commented, Oct 26, 2020
1reaction
Bennett-Lynchcommented, Oct 30, 2020

Nice article. Maybe @richardstartin would be interested, since he mentioned Netty specifically.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Finding Bytes in Arrays | Richard Startin's Blog
This post considers the benefits of branch-free algorithms through the lens of a trivial problem: finding the first position of a byte ......
Read more >
java - Find indexOf a byte array within another byte array
The simpelst way would be to compare each element: public int indexOf(byte[] outerArray, byte[] smallerArray) { for(int i = 0; ...
Read more >
SIMD-friendly algorithms for substring searching
A generic implementation calls a function like memcmp to compare ... This algorithm is suitable for all SIMD instruction sets and also SWAR...
Read more >
Best way to search for string in byte array? - Oracle Communities
Just build a String instance with the array of bytes and then use the indexOf method to locate the specific strings : byte[]...
Read more >
Richard Startin on Twitter: "You did it. You crazy son of a bitch, you ...
Implement SWAR indexOf byte search by franz1981 · Pull Request #10737 · netty/netty. Motivation: Faster indexOf Modification: Create generic SWAR indexOf ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found