Closed ProgrammerBruce closed 13 years ago
Note this implementation "cheats" a little, in that it serializes enum ordinal values instead of enum name values. (So, "player":0 is serialized instead of "player":"JAVA".) Since, this behavior passed the correctness checks of the test suite, I went with it. Will post to user group about changing correctness checks to require enum name values.
Never mind my previous comment. I ran the tests again, and got different results. I think the first test runs were flawed because my machine was very busy with other activities. Committing faster FastJSON serialization implementation that also correctly serializes enum names (not the ordinals).
For what its worth, other json impls do serializaze enum names, although I agree in that in many ways both could be viewed as acceptable (and numeric one can be faster).
FastJSON claims to be faster than Jackson. http://code.alibabatech.com/wiki/display/FastJSON