News for hackers. Stuff that matters.
Re:Show HN: Radix sort big files in memory by TheTank on Saturday May 09, 2020 @09:16AM (#23124465)
Thanks for sharing. Do I understand correctly that this requires loading the whole file in memory along with an ordered list of keys? Or is it just the first n bytes that are loaded in memory? If the former, then it seems very expensive in terms of RAM, particularly if your data file has multiple columns.

As an alternative I used is to load the file in a database, then sort by the key I want (which only loads the key in memory) and then output the result into a file. It does go through disk but you can address larger files as you only need the key in memory, and not the whole file.

Re:Show HN: Radix sort big files in memory by tleb_ on Saturday May 09, 2020 @10:25AM (#23124934)
It does a memory map (mmap). Your file is addressed in virtual memory. See https://en.wikipedia.org/wiki/Mmap and https://en.wikipedia.org/wiki/Memory-mapped_file
Re:Show HN: Radix sort big files in memory by afiodorov on Saturday May 09, 2020 @04:14PM (#23127935)
Indeed I load the entire file, but I think provided I have RAM to load the file with all the columns, the approach of loading everything should give me optimal performance. However I agree with your approach when there isn't enough RAM.