Skip to content
This repository has been archived by the owner on Feb 1, 2020. It is now read-only.

Can't reproduce performance #2

Open
danielpol opened this issue Aug 17, 2016 · 4 comments
Open

Can't reproduce performance #2

danielpol opened this issue Aug 17, 2016 · 4 comments

Comments

@danielpol
Copy link

I'm trying to reproduce the gensort performance you mention in the Readme. By they way, it would be great to have this running multi-threaded to take advantage of multiple cores.
If I use j1e8.c I get a "Bus error" when trying to sort.
If I use bsort.c or qsort.c I run for >24 hours without finishing.
Worth to mention that when compiling bsort.c I get these warnings:
bsort.c: In function ‘shellsort’:
bsort.c:36:7: warning: passing argument 1 of ‘memcpy’ discards ‘const’ qualifier from pointer target type [enabled by default]
memcpy(a+j_record_size, a+(j-3)_record_size, record_size);
^
In file included from bsort.c:4:0:
/usr/include/string.h:42:14: note: expected ‘void * restrict’ but argument is of type ‘const unsigned char _’
extern void *memcpy (void *__restrict __dest, const void *__restrict __src,
^
bsort.c:38:5: warning: passing argument 1 of ‘memcpy’ discards ‘const’ qualifier from pointer target type [enabled by default]
memcpy(a+j_record_size, &temp, record_size);
^
In file included from bsort.c:4:0:
/usr/include/string.h:42:14: note: expected ‘void * restrict’ but argument is of type ‘const unsigned char _’
extern void *memcpy (void *__restrict __dest, const void *__restrict __src,
^
bsort.c:44:7: warning: passing argument 1 of ‘memcpy’ discards ‘const’ qualifier from pointer target type [enabled by default]
memcpy(a+j_record_size, a+(j-1)_record_size, record_size);
^
In file included from bsort.c:4:0:
/usr/include/string.h:42:14: note: expected ‘void * restrict’ but argument is of type ‘const unsigned char *’
extern void *memcpy (void *__restrict __dest, const void *__restrict __src,
^
bsort.c:46:5: warning: passing argument 1 of ‘memcpy’ discards ‘const’ qualifier from pointer target type [enabled by default]
memcpy(a+j_record_size, &temp, record_size);
^
In file included from bsort.c:4:0:
/usr/include/string.h:42:14: note: expected ‘void * restrict’ but argument is of type ‘const unsigned char *’
extern void *memcpy (void **restrict __dest, const void __restrict __src,
^
bsort.c: In function ‘radixify’:
bsort.c:128:11: warning: passing argument 1 of ‘memcpy’ discards ‘const’ qualifier from pointer target type [enabled by default]
memcpy(&buffer[stack[stack_pointer] * record_size], &buffer[stack[stack_pointer-1] * record_size], record_size);
^
In file included from bsort.c:4:0:
/usr/include/string.h:42:14: note: expected ‘void * __restrict
’ but argument is of type ‘const unsigned char *’
extern void *memcpy (void **restrict __dest, const void __restrict __src,
^
bsort.c:131:9: warning: passing argument 1 of ‘memcpy’ discards ‘const’ qualifier from pointer target type [enabled by default]
memcpy(&buffer[stack[0] * record_size], &temp, record_size);
^
In file included from bsort.c:4:0:
/usr/include/string.h:42:14: note: expected ‘void * __restrict
’ but argument is of type ‘const unsigned char *’
extern void *memcpy (void *__restrict __dest, const void *__restrict __src,

@adamdeprince
Copy link
Contributor

adamdeprince commented Sep 3, 2016

Yeah, I have to clean up the warnings. What are your source files? How large are they? How much ram do you have? What is your underlying file system and I/O device? bsort is designed to perform very very well when swapping heavily, but qsort, a direct application of linux's underlying qsort function, performs very poorly when paging. j11e8 is designed for a very specific input, and deviation from that is "undefined" :-)

I may at some point make this code multithreaded - bsort is really I/O, not CPU, bound, and would benefit tremendously from having as many inflight threads as possible.

@danielpol
Copy link
Author

I run this on output generated by gensort (100 bytes fixed binary records with 10 fixed binary key). ~10GB source files. I ended up using nsort trial version to do my testing.

@harveywi
Copy link

@danielpol, try turning on the "-v" verbose flag and seeing what happens with different values for the "-c" parameter. In my case, sorting a very small 10MB file of 128-bit numbers took over a minute, but I increased "-c" and achieved much better performance.

Some discussion about the effect of the various command line parameters would be a nice addition to the readme.

@adamdeprince
Copy link
Contributor

adamdeprince commented Jan 23, 2019 via email

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants