News for hackers. Stuff that matters.
Re:How long does it take to linear search 200MB in memory? by calibration263 on Friday April 27, 2018 @08:15PM (#16945418)
Using the same algorithm I got 0.175 or so seconds in Java.

Sample code: https://pastebin.com/duYF2QfE

This was on a "Early 2015" rMBP with a 3.1 GHz i7.

Re:How long does it take to linear search 200MB in memory? by vardump on Friday April 27, 2018 @08:50PM (#16945538)

  if (data[i] == strArr[found]) {
Shouldn't that be:

  if (data[i] == stringToFind.codePointAt(found)) {
... if you claim to use the same algorithm. That's what golang needs to do to index a UTF-8 string, right? (Comparing to golang single core version.)

That way both golang and Java will be performing proper unicode code point indexing.

Of course the optimization you made makes sense, but I think it'd be fair for the golang version to do same.