.jshintrc
author Jun Wu <quark@fb.com>
Sat, 03 Mar 2018 12:39:11 -0800
changeset 36703 c420792217c8
parent 35183 bdd2e18b54c5
permissions -rw-r--r--
xdiff: reduce indent heuristic overhead Adds some threshold to avoid expensive cases, like: ``` #!python open('a', 'w').write(" \n" * 1000000) open('b', 'w').write(" \n" * 1000001) ``` The indent heuristic is O(N * 20) (N = 1000000) for the above case, and makes diff much slower. Before this patch (system git 2.14.2): ``` git diff --no-indent-heuristic a b 0.21s user 0.03s system 100% cpu 0.239 total git diff --indent-heuristic a b 0.77s user 0.02s system 99% cpu 0.785 total ``` After this patch (git 2fc74f41, with xdiffi.c patched): ``` # with the changed xdiffi.c git diff --indent-heuristic a b 0.16s user 0.01s system 90% cpu 0.188 total git diff --no-indent-heuristic a b 0.18s user 0.01s system 99% cpu 0.192 total ``` Now turning on indent-heuristic has no visible impact on performance. Differential Revision: https://phab.mercurial-scm.org/D2601
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
35183
bdd2e18b54c5 hgweb: add .jshintrc with some basic rules
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
     1
{
bdd2e18b54c5 hgweb: add .jshintrc with some basic rules
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
     2
    // Enforcing
bdd2e18b54c5 hgweb: add .jshintrc with some basic rules
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
     3
    "eqeqeq"        : true,     // true: Require triple equals (===) for comparison
bdd2e18b54c5 hgweb: add .jshintrc with some basic rules
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
     4
    "forin"         : true,     // true: Require filtering for..in loops with obj.hasOwnProperty()
bdd2e18b54c5 hgweb: add .jshintrc with some basic rules
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
     5
    "freeze"        : true,     // true: prohibits overwriting prototypes of native objects such as Array, Date etc.
bdd2e18b54c5 hgweb: add .jshintrc with some basic rules
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
     6
    "nonbsp"        : true,     // true: Prohibit "non-breaking whitespace" characters.
bdd2e18b54c5 hgweb: add .jshintrc with some basic rules
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
     7
    "undef"         : true,     // true: Require all non-global variables to be declared (prevents global leaks)
bdd2e18b54c5 hgweb: add .jshintrc with some basic rules
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
     8
bdd2e18b54c5 hgweb: add .jshintrc with some basic rules
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
     9
    // Environments
bdd2e18b54c5 hgweb: add .jshintrc with some basic rules
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
    10
    "browser"       : true      // Web Browser (window, document, etc)
bdd2e18b54c5 hgweb: add .jshintrc with some basic rules
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
    11
}