How to compare diversity between different ecosystems?
Have a look at the Wikipedia page on Diversity Index

Here are the indices that the wikipedia page describes


"True Diversity" Index
Species Richness
Shannon Index
Rényi entropy
Simpson index
Inverse Simpson index
Gini–Simpson index
Berger–Parker index


The article also links to related concepts such as


$\alpha$ Diversity
$\beta$ Diversity
$\gamma$ Diversity
Isolation Diversity
Relative Species Abundance


The literature is important on the question of measuring species diversity, ecosystemic function diversity and genetic diversity. What you want to use very much depends on your interest. Just to cite one other example: In the conservation literature, total sum of branch length over a phylogeny is sometimes used as measure of diversity and is sometimes used for prioritize populations (see for example Curnick et al. 2015). This method implicitely assume that more distantely related branches have different ecosystemic functions and keeping many of these functions is good for conservation purpose.