lgbo-ustc commented on issue #7455:
URL:
https://github.com/apache/incubator-gluten/issues/7455#issuecomment-2407067087
Try to replace the implmentation by
```c++
if (b & (b - 1))
{
libdivide::divider<A> divider(static_cast<A>(b));
for (size_t i = 0; i < size; ++i)
{
/// NOTE: perhaps, the division semantics with the remainder
of negative numbers is not preserved.
dst[i] = static_cast<ResultType>(src[i] - (src[i] / divider)
* b);
}
}
else
{
// gcc libdivide doesn't work well for pow2 division
#if 0
auto mask = b - 1;
for (size_t i = 0; i < size; ++i)
dst[i] = static_cast<ResultType>(src[i] % b);
}
```
The performace drops significantly. From
```
100000000 rows in set. Elapsed: 0.289 sec. Processed 100.00 million rows,
800.00 MB (345.76 million rows/s., 2.77 GB/s.)
```
to
```
100000000 rows in set. Elapsed: 0.911 sec. Processed 100.00 million rows,
800.00 MB (109.74 million rows/s., 877.95 MB/s.)
```
--
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]