On comparing Swift runtime performances
andreaferretti
kmeans
C2015–2015
andreaferretti / kmeans
kmeans
KMeans benchmark
3Distinct people
3Mentions
0Explicit recommenders
135GitHub stars
What to know before exploring
What it is
KMeans benchmark
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, 5:04:57 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 month3 dated mentions
Observed mentions: 2015-02-22 14:56:08 UTC to 2015-12-17 18:21:43 UTC.
Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.
View mention counts and date ranges
| Period | Start (UTC) | End (exclusive, UTC) | Mentions | Submissions | Comments |
|---|---|---|---|---|---|
| Feb 2015 | 2015-02-01 00:00:00 UTC | 2015-03-01 00:00:00 UTC | 2 | 0 | 2 |
| Mar 2015 | 2015-03-01 00:00:00 UTC | 2015-04-01 00:00:00 UTC | 0 | 0 | 0 |
| Apr 2015 | 2015-04-01 00:00:00 UTC | 2015-05-01 00:00:00 UTC | 0 | 0 | 0 |
| May 2015 | 2015-05-01 00:00:00 UTC | 2015-06-01 00:00:00 UTC | 0 | 0 | 0 |
| Jun 2015 | 2015-06-01 00:00:00 UTC | 2015-07-01 00:00:00 UTC | 0 | 0 | 0 |
| Jul 2015 | 2015-07-01 00:00:00 UTC | 2015-08-01 00:00:00 UTC | 0 | 0 | 0 |
| Aug 2015 | 2015-08-01 00:00:00 UTC | 2015-09-01 00:00:00 UTC | 0 | 0 | 0 |
| Sep 2015 | 2015-09-01 00:00:00 UTC | 2015-10-01 00:00:00 UTC | 0 | 0 | 0 |
| Oct 2015 | 2015-10-01 00:00:00 UTC | 2015-11-01 00:00:00 UTC | 0 | 0 | 0 |
| Nov 2015 | 2015-11-01 00:00:00 UTC | 2015-12-01 00:00:00 UTC | 0 | 0 | 0 |
| Dec 2015 | 2015-12-01 00:00:00 UTC | 2016-01-01 00:00:00 UTC | 1 | 1 | 0 |
What Hacker News says
3 sourcesFAfabiofumarola·Dec 17, 2015Submission
Since swift is released as open source it would be interesting to compare swift performances. I found the interesting project http://github.com/andreaferretti/kmeans that compares the execution time of the KMeans algorithm on several languages.
From the results it looks like that the execution time is comparable to python and it is pretty distant from the top.
http://github.com/andreaferretti/kmeans/blob/master/results
Results
-------
nim (0.11.3) 148 ms
java (1.7.0_76) 183 ms
....
python (2.7.6) 10632 ms
pharo (3) 11170 ms
swift (2.2-dev) 11391 ms
perl (5.20.2) 15680 ms
rubinius (2.5.2) 20878 ms
ruby (1.9.3p484) 24819 ms
1 points · Open discussionThe last time this post appeared, I actually submitted a PR which did this, among other things: https://github.com/andreaferretti/kmeans/pull/3
The post wasn't really updated.
In On Rust and Nim>>the whole language is verbose: compare these 10 lines (https://github.com/andreaferretti/kmeans/blob/935b8966d4fe0d...) with this single line (https://github.com/andreaferretti/kmeans/blob/master/nim/alg...)
The Nim code's more concise in this case but the Rust code can be more clearly written:
impl Add for Point {
type Output = Point;
fn add(self, other: Point) -> Point {
Point(self.0 + other.0, self.1 + other.1)
}
}
The "type Output = Point" line isn't boilerplate, it makes it possible to define the result of an addition as something other than a Point. (Off of the top of my head I can't think of any use cases, but I'm happy with the capability personally).
In On Rust and Nim