I am using JSF 2.0 and I am looking for a copmponent library with minimal load in terms of performance. Which one is better to use if I have choice between RichFaces and PrimeFaces? What are the advantages and disadvantages of both?
Both are cool. Richfaces is more developed and tested generally, since primefaces came out later than RF. Just have a look at the component showcase and choose the one you prefer.
Or even better, you can use both together, there are no compatibility problems.
The advantages is that you have a lot of components ready to use out-of-the-box. The disadvantage is that sometimes you don't have full control about what a component can or can't do (but you can always create your own component extending a library component), and that you have to load some libraries into the client side for them to work (make sense, but it decreases performance)
Currently Primefaces is the only component lib that I know of (for now) that has a complete JSF2 implementation. There are bugs and problems, and some components are to be rewritten, but development is lightning fast, the communication is excellent (I don't remember a single post on their support forum that hasn't been answered by Cagatay himself), and it is moving in the right direction (the new theming system is an example of that IMHO). I think Primefaces will be a mature JSF2 component lib by the end of the year.
There are some others, like Icefaces that I played with for a short time, but they are moving slowly and like I said, none of them are really JSF2 yet. Part of the reason for this is that Mojarra, the Sun reference implementation is quite buggy, and there some serious bugs that these component lib developers are waiting for to get fixed.
So my vote is definitely on Primefaces for now, we'll see how it will look like later.
If you are evaluating PrimeFaces, following page would help;