fgets-sse2 v0.01 released
#7
If file does not end in new line, than last line is discarded.

I fix the issue is in code below:
for (i = 0; i < BUFFER_EXTRA; i++, num++)
{
if (ctx->buf[num - 1] == '\n'){
break;
}
const int c = fgetc (stream);

if (c == EOF) {
ctx->buf[num] = '\0'; <--- this seems to fix it.
break;
}
ctx->buf[num] = c;
}


After looking the code, I think that most of speedup is actually comming from using fread rather than assembly, though assembly adds some speedup.

Btw, if anyone is going to use that code, all those malloced/calloced buffers needs to be freed as well.
Reply


Messages In This Thread
fgets-sse2 v0.01 released - by atom - 01-06-2013, 08:39 PM
RE: fgets-sse2 v0.01 released - by epixoip - 01-06-2013, 08:42 PM
RE: fgets-sse2 v0.01 released - by undeath - 01-06-2013, 08:44 PM
RE: fgets-sse2 v0.01 released - by M@LIK - 01-07-2013, 05:46 AM
RE: fgets-sse2 v0.01 released - by Mangix - 08-06-2013, 12:22 AM
RE: fgets-sse2 v0.01 released - by arthur - 10-16-2013, 09:07 PM
RE: fgets-sse2 v0.01 released - by arthur - 10-17-2013, 09:50 AM