HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
MikeMirzayanov
binary-heap-benchmark
C#2017–2017
MikeMirzayanov / binary-heap-benchmark

binary-heap-benchmark

Collection of binary heap sort implementation for many languages, primary to compare performance between languages

3Distinct people
3Mentions
0Explicit recommenders
41GitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

Collection of binary heap sort implementation for many languages, primary to compare performance between languages

GitHub

Where it is used

No documented product use has been verified yet.

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

No other repository is repeatedly linked in the same discussions.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 3:56:07 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by hour3 dated mentions

Observed mentions: 2017-06-09 12:01:50 UTC to 2017-06-09 19:13:44 UTC.

012017-06-09 12:00:00 UTC to 2017-06-09 13:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 commentsJun 9, 12:002017-06-09 13:00:00 UTC to 2017-06-09 14:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2017-06-09 14:00:00 UTC to 2017-06-09 15:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2017-06-09 15:00:00 UTC to 2017-06-09 16:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 commentsJun 9, 15:002017-06-09 16:00:00 UTC to 2017-06-09 17:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2017-06-09 17:00:00 UTC to 2017-06-09 18:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2017-06-09 18:00:00 UTC to 2017-06-09 19:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2017-06-09 19:00:00 UTC to 2017-06-09 20:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 commentsJun 9, 19:00

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
Jun 9, 12:002017-06-09 12:00:00 UTC2017-06-09 13:00:00 UTC101
Jun 9, 13:002017-06-09 13:00:00 UTC2017-06-09 14:00:00 UTC101
Jun 9, 14:002017-06-09 14:00:00 UTC2017-06-09 15:00:00 UTC000
Jun 9, 15:002017-06-09 15:00:00 UTC2017-06-09 16:00:00 UTC000
Jun 9, 16:002017-06-09 16:00:00 UTC2017-06-09 17:00:00 UTC000
Jun 9, 17:002017-06-09 17:00:00 UTC2017-06-09 18:00:00 UTC000
Jun 9, 18:002017-06-09 18:00:00 UTC2017-06-09 19:00:00 UTC000
Jun 9, 19:002017-06-09 19:00:00 UTC2017-06-09 20:00:00 UTC101

What Hacker News says

3 sources
If your code looks like this: https://github.com/MikeMirzayanov/binary-heap-benchmark/blob... Then you probably should not use Python, python is more of a glue language which you should strive to make your program looking like a business logic, in real word to solve this problem you would write code such as this: import time if __name__ == "__main__": start = time.clock() N = 10000000 h = list(range(N)) h.sort() for i, v in enumerate(h): assert(i == v) print("Done in %f" % ((time.clock() - start) * 1000)) $ python3.6 heap.py Done in 2389.877000 Or if heap needs to be used: import time from heapq import heapify, heappop if __name__ == "__main__": start = time.clock() N = 10000000 h = list(range(N)) heapify(h)
Read the rest
for i in range(len(h)): assert(i == heappop(h)) print("Done in %f" % ((time.clock() - start) * 1000)) $ python3.6 heap.py Done in 10716.348000 Micro benchmarks are silly because you'll never do those things in real code.
In PyPy v5.8 released
Newsflash: code like this[1] will never be fast in CPython, and if you write a lot of code like that and are sad when it's slow then you need a different language, especially if you expect it to be as fast as a JIT compiled language like js on v8. Or use something like Cython. That benchmark is pretty meaningless anyway, IMO. Here are some halfway decent, official and up to date benchmarks comparing python 2 and python 3[2]. Python 3 is slower in some areas, noticilby startup time, but it's not all doom and gloom. It's faster in a lot of places. And productivity is hard to benchmark, but IMO py3 is way better in the area. 1. https://github.com/MikeMirzayanov/binary-heap-benchmark/blob... 2. https://speed.python.org/comparison/?exe=12%2BL%2B3.6%2C12%2...
In PyPy v5.8 released
I have a question and then a general vent 1. Does anyone know the latest update on NumPyPy? PyPy for me is just not a usable proposition because I heavily use Numpy (and Scipy et al). So I am forced to use slow Python + fast Numpy or slow Numpy + fast Python. Very saddening. The C-Extension is just so off the pace, NumPyPy was meant to solve that quandry. And I know some smart Alec will trot out the usual 'downshift into C' line that everyone (including Guido) use as the final goto solution for performance but that is simply a disgrace in 2017. Even JavaScript is fast. Why can I not choose to write Python and it be fast?? And yet Python 3 is getting slower. Don't agree? Look at these benchmarks of Python heaps written in Python (not using the C based builtin heapq) https://github.com/MikeMirzayanov/binary-heap-benchmark Python generally
Read the rest
is off the pace but Python 3 is about twice as slow as 2 and miles off JavaScript. But PyPy is proof that Python can be fast. It makes quote/unquote "Pure Python" within striking distance of Go and and when I run that test suit on PyPy, its similar to the Node.js score. Why does this matter? Because I want to write bloody Python not C. And it is so tantalisingly close - look at a blog post like: https://dnshane.wordpress.com/2017/02/14/benchmarking-python... The performance of the Fibonacci Heap that someone wrote in quote/unquote "Pure Python", when run in CPython can never compete with HeapQ (the C based builtin lib), but on PyPy it can. Fast code written in Python. So what are the problems holding back PyPy? I think possibly money and number of devs working on stuff. Javascript had Mozilla, Google, Microsoft and Apple in a browser war + loads of open source input. But is the biggest stumbling block not Guido himself and the core Python devs? Do they just philosophically not agree with PyPy or is it just disinterest? Well whatever it is, it is heart-breaking to want to write fast code in my favourite language and leverage all its power including Numpy/Scipy etc and not be able to. And yes my use-case is perhaps quite unique, a very CPU intensive service that ideally computes and returns a real-time calculation (that includes 500k function calls) in 10-50ms. But getting fast Numpy in the PyPy mix (i.e all the speed of the JIT + no worse Numpy) would be a HUGE step forward for me in PyPy adoption. What is the latest? How can I help?
In PyPy v5.8 released

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.