Java HashMap vs JSONObject

Viewed 29664

I am wondering about the performance of Java HashMap vs JSONObject.

It seems JSONObject stores data internally using HashMap. But JSONObject might have additional overhead compared to HashMap.

Does any one know about the performance of Java JSONObject compared to HashMap?

Thanks!

5 Answers

The only performance overhead is on casting data! As you JSONObject stores data on a HashMap of objects and it casts the datatype you want.

Related