You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have made the below modification to the ExtensionManifestParser and it seems that the general performance of our JSON in comparing to the native JSONparse is OK'ish there are cases in which it is very bad. For instance parsing css/package.json takes 0.3ms using JSON.parse it takes 8ms using our parser. Other larger json files show similar behaviour.
lett1=process.hrtime();constextensionDescription=json.parse(manifestContents.toString(),errors);letd=process.hrtime(t1);letD1=(d[0]*1e9+d[1])/1e6;lett2=process.hrtime();JSON.parse(manifestContents.toString());letd2=process.hrtime(t2);letD2=(d2[0]*1e9+d2[1])/1e6;console.log(`PARSE + ${this._absoluteManifestPath} took ${D1}ms, NATIVE ${D2}ms`);
The text was updated successfully, but these errors were encountered:
Assigning @aeschli to see if there is something low hanging that can be improved and @sandy081 to check if we can get away with stripping comments and using JSON.parse
Comments are not valid in package.json. We can use the native json.parser. The only difference is that our implementation is fault tolerant, but IMO that's not important here.
I had a quick look at our parser implementation and also improved it slightly, but it's unlikely that we can match the native implementation.
aeschli
changed the title
json parser performance issues
improve package.json parsing performance
Jan 7, 2017
I have made the below modification to the
ExtensionManifestParser
and it seems that the general performance of our JSON in comparing to the native JSONparse is OK'ish there are cases in which it is very bad. For instance parsingcss/package.json
takes 0.3ms usingJSON.parse
it takes 8ms using our parser. Other larger json files show similar behaviour.The text was updated successfully, but these errors were encountered: