BIS_fnc_consolidateArray is really, really slow, and could use a command to replace it. I managed to get a 3x speed increase by making a custom version of this function using HashMaps, but I believe that is still very much slower than an engine command could do.
Syntax examples:
consolidateArray ARRAY
consolidateArray ["apple","apple","pear","pear","apple"]; //Return: [["apple",3],["pear",2]]
This could (and probably should) be a HashMap as well:
_fruitMap = consolidateArray ["apple","apple","pear","pear","apple"]; _fruitMap get "apple" // Return: 3