Category Posts Widget 3.2

Adds the much requested option to change the sort order of the posts. Check it out at the plugin directory.

I know this is a long time coming but I’ve been super busy with school. I don’t like to mess with something that works. I know of a few other plugins that do the same thing and more but I don’t like to add a hundred different features that only a handful of people need. I think one of the features of CPW is its minimal feature set. It functions as advertised; no more no less. That, in my opinion, is how good software should work.

Based on the ratings and comments it seems most people enjoy the plugin. Sadly, I don’t have time to answer everyone’s questions. I’d suggest posting on the WordPress.org forums. Thanks for all the support.

Update: The random sort bug should be fixed now. Sorry for the delay.

Scala HashMap performance

In the spirit of science and experimentation, I compared the performance of Scala’s immutable HashMap against it’s mutable cousin. I also compared it to Java’s HashMap just for kicks.

The code I used to run this performance comparison is below. It’s a standalone program that accepts two arguments: (1) the number of elements to insert in each trial and (2) the number of trials to run.

Here are the results of inserting 1,000,000 elements per trial and 10 trials on a MacBook Pro with a 2.53 GHz Core 2 Duo and 4 GB RAM.

This is a performance test comparing java.util.HashMap,
scala.collection.immutable.HashMap, and scala.collection.mutable.HashMap.
The test inserts 1000000 elements into each map.

Testing Scala Immutable HashMap
6.927
6.941
7.076
7.076
7.068
6.89
6.74
6.709
6.959
7.158
----------
Mean: 6.9300000000000015

Testing Scala Mutable HashMap
2.623
2.549
2.566
2.53
2.546
2.558
2.485
2.658
2.545
2.534
----------
Mean: 2.5760999999999994

Testing Java HashMap
1.729
1.766
1.696
1.683
1.741
1.809
1.755
1.738
1.734
1.775
----------
Mean: 1.8318000000000005

I think it’s pretty clear that while immutable data structures are pretty nice, they come at a huge performance cost.