Skip to content

Instantly share code, notes, and snippets.

View antonmks's full-sized avatar

Anton antonmks

  • Miskatonic University
  • Arkham, MA, USA
View GitHub Profile
def find_max(efficiency):
efficiency.sort()
max_eff = -1
max_ind = 0
max_eff = efficiency[1]-efficiency[0]
if efficiency[len(efficiency)-1]-efficiency[len(efficiency)-2] > max_eff:
max_ind = len(efficiency)-1
max_eff = efficiency[len(efficiency)-1]-efficiency[len(efficiency)-2]
@antonmks
antonmks / gist:1273c5923f0ffda1ecd988d57d3788f7
Last active November 29, 2018 13:37
Sort scalability on modern cpus
Sort scalability on modern cpus
We don't need core counts of thirty
If we win by playing dirty!
Lets test linux sort on Coffee Lake generation processor :
System : Ubuntu 16, 6 cores i5-8500, 16GB of DDR4, Nvidia GTX 1080
Test file : 760 MB text file of tab separated numeric and text fields from TPC-H benchmark
The sort program is run repeatedly, so the source file is read from cache, the results are written
to /dev/null so we are comparing the cpu sort performance and not the disk performance.
#include <algorithm>
#include <ctime>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <vector>
#include <numeric>
#include <sstream>
#include <stdint.h>
#include <algorithm>
#include <ctime>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <map>
#include <numeric>
#include <sstream>
#include <stdint.h>
#include <algorithm>
#include <ctime>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <map>
#include <numeric>
#include <sstream>
#include <stdint.h>
#include <algorithm>
#include <ctime>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <map>
#include <numeric>
#include <sstream>
#include <stdint.h>
@antonmks
antonmks / Query 11
Last active May 30, 2017 11:45
Query 11
#include <algorithm>
#include <ctime>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <map>
#include <numeric>
#include <sstream>
#include <stdint.h>
#include <algorithm>
#include <ctime>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <map>
#include <numeric>
#include <sstream>
#include <stdint.h>
#include <algorithm>
#include <ctime>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <map>
#include <numeric>
#include <sstream>
#include <stdint.h>
#include <algorithm>
#include <ctime>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <map>
#include <numeric>
#include <sstream>
#include <stdint.h>