快速扁平化、反扁平化json结构 | Fastest way to flatten / un-flatten nested JSON objects

Here’s my much shorter implementation:

JSON.flatten hasn’t much changed (and I’m not sure whether you really need those isEmpty cases):

Together, they run your benchmark in about the half of the time (Opera 12.16: ~900ms instead of ~ 1900ms, Chrome 29: ~800ms instead of ~1600ms).

 

from:http://stackoverflow.com/questions/19098797/fastest-way-to-flatten-un-flatten-nested-json-objects

发表评论

您的电子邮箱地址不会被公开。