Git Product home page Git Product logo

myexternalsort's Introduction

Simple External Sort

The simple external sort program The idea is simple:

  • Split the file into small chunks, sort them and write the disk
  • Merge the sorted files together using MinHeap

Build and test:

Build:
  • Create build directory
  • Navigate to build and call cmake .. && make
Generate random text file: ./bin/generate_text_file <filename> <size>
Run the test: ./bin/external_sort <input file> <output file> <limit memory>

Performance vs Linux sort

  • My ex-sort:
$ time ./bin/external_sort input1G.txt output.txt 104857600
Sorting with:
	Thread(s): 6
	Limit files: 1024

real	0m44.421s
user	1m36.815s
sys	0m5.286s
  • Linux sort:
$ time sort input1G.txt -S 104857600 -o output2.txt

real	1m52.348s
user	4m48.628s
sys	0m13.810s

myexternalsort's People

Contributors

nguyenhien1994 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.