json-comments icon indicating copy to clipboard operation
json-comments copied to clipboard

Slows down my application for 10 seconds

Open catamphetamine opened this issue 10 years ago • 2 comments

See: https://github.com/strongloop/express/issues/2583

Removed this line and it worked:

JSONC = require('json-comments')

Resorted to using this module instead: https://github.com/sindresorhus/strip-json-comments

catamphetamine avatar Mar 11 '15 12:03 catamphetamine

When the json file is big enough. The module don`t run quickly.

See https://github.com/numbcoder/json-comments/blob/master/lib/jsonc.js

The algorithm is too slow.

f111fei avatar Jan 23 '16 08:01 f111fei

Had the same problem and was also forced to change to strip.json-comments. :-(

From my perspective, the problem is that you cannot avoid that JSONC installs itself globally. If it would only provide the JSONC object, you would have control and could use it only for small files. But if it is globally installed in a real world application, the extra costs of swapping out the fast default JSON parser is just too high.

philipp-classen avatar May 28 '18 13:05 philipp-classen