1
1
mirror of https://github.com/github/semantic.git synced 2024-12-19 12:51:52 +03:00
Commit Graph

25808 Commits

Author SHA1 Message Date
Patrick Thomson
2ea6747370 Merge pull request #2217 from github/ghc-rtsopts
[Experiment] Improve compile speed with larger GHC allocation area
2018-10-18 17:09:55 -04:00
Patrick Thomson
b9d4201ddb Merge branch 'master' into ghc-rtsopts 2018-10-18 13:05:37 -04:00
Josh Vera
f458fe580c Merge pull request #2206 from github/quiet-parsing
New cli switch for quiet parsing with timing stats
2018-10-18 11:27:11 -04:00
Josh Vera
b5714f28c4 Merge branch 'master' into quiet-parsing 2018-10-18 10:55:45 -04:00
Patrick Thomson
f4b5f0d44e [Experiment] Improve compile speed with larger GHC allocation area 2018-10-17 21:27:22 -04:00
Patrick Thomson
26da3d463a Merge pull request #2216 from github/split-up-haskell-syntax
Split up Language.Haskell.Syntax into child modules.
2018-10-17 21:27:03 -04:00
Patrick Thomson
379d75f284 Split up Language.Haskell.Syntax into child modules.
This was the longest (in terms of line count) file in the project.
Splitting it up will save on compile time, as it did for TypeScript.
I observe a ~20sec speedup from `stack clean semantic && stack build semantic:lib`
2018-10-17 18:57:29 -04:00
Patrick Thomson
42bb569ba9 Merge pull request #2214 from github/nfdata-instances
Add NFData instances to enable more accurate benchmarking.
2018-10-17 16:43:12 -04:00
Patrick Thomson
f911b43b63 fix lints 2018-10-17 14:38:30 -04:00
Patrick Thomson
ac543651ee Add NFData instances to enable more accurate benchmarking.
Because we're getting serious about benchmarking in the run-up to
Windrose, it's time to bring in the `deepseq` package to ensure that
benchmarks can fully evaluate the result of a test case.

The `deepseq` package provides an `NFData` typeclass:

```
class NFData a where
  rnf :: a -> ()
```

Instances use the `seq` combinator to ensure that the argument to
`rnf` is fully evaluated, returning (). If there is a `Generic`
instance for `a`, the implementation can be omitted. This patch adds
NFData for every syntax node, graph vertex, environment data
structures, and exceptions. It is long, but the work is very
straightforward, so don't panick.

The benchmark suite (`stack bench`) now produces more accurate
results. The benchmarks previously mimicked `rnf` by calling `show` on
the result of an evaluation or graph construction; now that we have
actual `NFData` instances we can use the `nfIO` combinator from
criterion. This has sped up the evaluation benchmarks and reduced
their memory consumption, while it has slowed down the call graph
benchmarks, as those benchmarks weren't evaluating the whole of the
graph.

Unfortunately, this patch increases compile times, as we have to
derive a few more Generic instances. I wish this weren't the case, but
there's little we can do about it now. In the future I have some plans
for how to reduce compile time, and I bet that those gains will at
least nullify the speed hit from this patch.

Now that we have NFData instances for every data type, we can start
benchmarking assignments, in preparation for fixing #2205.

This patch also pulls in updates to `effects` and `fastsum` that add
appropriate NFData instances for the data they vend.
2018-10-17 14:08:47 -04:00
Timothy Clem
a19d8bd02e Revert removal of wait 2018-10-17 10:03:46 -07:00
Ayman Nadeem
1dce4b089b Merge branch 'quiet-parsing' of https://github.com/github/semantic into quiet-parsing 2018-10-17 12:12:23 -04:00
Ayman Nadeem
97b6c48c95 remove results 2018-10-17 12:12:12 -04:00
Timothy Clem
3b0a19238f Merge branch 'quiet-parsing' of github.com:github/semantic into quiet-parsing 2018-10-17 08:37:21 -07:00
Timothy Clem
070c15a947 Merge remote-tracking branch 'origin/master' into quiet-parsing 2018-10-17 08:18:33 -07:00
Patrick Thomson
abce41c1e1 Merge pull request #2211 from github/bracket-effect
Fix crash/race associated with `bracket` (#2207)
2018-10-16 23:34:04 -04:00
Patrick Thomson
d3db754004 weirdness in tests 2018-10-16 23:04:39 -04:00
Patrick Thomson
d56badfb29 Use upstream Resource effect. 2018-10-16 20:11:38 -04:00
Ayman Nadeem
f0dcd1d2fc attempt to make this less manual 2018-10-16 18:01:28 -04:00
Timothy Clem
602432359b Merge remote-tracking branch 'origin/bracket-effect' into quiet-parsing 2018-10-16 14:57:14 -07:00
Patrick Thomson
ebda4bfaa1 Merge branch 'master' into bracket-effect 2018-10-16 17:52:30 -04:00
Patrick Thomson
a9ab40b7a5 Merge pull request #2197 from github/port-rewriting-examples
Port rewriting examples to the Rewrite DSL.
2018-10-16 17:46:02 -04:00
Patrick Thomson
1de1f0b5c1 try catching ParserTimedOut exceptions in parse-examples 2018-10-16 17:39:36 -04:00
Patrick Thomson
fb1806f3e9 whoops 2018-10-16 17:18:59 -04:00
Patrick Thomson
37522ddc35 lints 2018-10-16 17:15:36 -04:00
Patrick Thomson
1dfb4981cc warnings 2018-10-16 17:10:34 -04:00
Patrick Thomson
75bf696e47 Fix crash/race associated with bracket (#2207)
The bracket that I wrote inside effects does not properly handle
asynchronous exceptions, as it has no way to call the mask function.
As such, because the asynchronous exception is rethrown by both
`bracket` and `wait`, the exception handler will trigger twice. This
is what is causing the crash: `bracket` is passing the TSParser we
create in parseToAST to ts_parser_delete twice.

The best thing to do here is to create the new `Resource` effect,
which is interpreted down to `Control.Exception.bracket`, which has
the correct asynchronous-masking behavior, unlike the `bracket` in
`Control.Monad.Effect.Exception`, which I propose to remove in a patch
to `effects`.

This also bumps haskell-tree-sitter so that the
`ts_node_copy_child_nodes` function is considered `interruptible`.

To test:

1. Download [this file](https://gist.ghe.io/tclem/c2ffe3d20b248fdac59588aa98f168ae)
2. Run `TREE_SITTER_PARSE_TIMEOUT=1000 stack exec semantic -- --log-level=debug parse lexer.rb`

Before applying this patch, you will see a crash associated with a
double-free; afterwards, it should time out normally.
2018-10-16 17:05:29 -04:00
Ayman Nadeem
f9a3966a3c github universe results 2018-10-16 15:55:24 -04:00
Ayman Nadeem
2cb9b43ad5 entitlements results 2018-10-16 15:55:02 -04:00
Ayman Nadeem
66c397bd73 airflow results 2018-10-16 15:54:50 -04:00
Timothy Clem
0d762fba86 Include blob language in output too 2018-10-16 11:40:26 -07:00
Timothy Clem
4fc7bb59ae No need for double async (timeout already does this) 2018-10-16 11:28:53 -07:00
Patrick Thomson
5e52bede0a Fix the test suite. 2018-10-15 12:47:18 -04:00
Patrick Thomson
b7364f6df7 Merge remote-tracking branch 'origin/master' into port-rewriting-examples 2018-10-15 11:22:06 -04:00
Patrick Thomson
14b4ed0bc7 Merge pull request #2204 from github/declaration-matching-improvement
Refactor: remove duplicate code in Analysis.Declaration
2018-10-12 20:22:34 -04:00
Timothy Clem
7663c46d79 New cli switch for quiet parsing with timing stats 2018-10-12 12:47:11 -07:00
Timothy Clem
c04d165a2b Merge branch 'master' into declaration-matching-improvement 2018-10-10 15:22:20 -07:00
Patrick Thomson
deb0956a8e remove annoying duplication 2018-10-10 12:49:25 -04:00
Patrick Thomson
8c19724cbe Merge branch 'port-rewriting-examples' of github.com:github/semantic into port-rewriting-examples 2018-10-10 12:37:37 -04:00
Patrick Thomson
ecb3d0cec3 Merge branch 'master' into port-rewriting-examples 2018-10-10 12:20:33 -04:00
Patrick Thomson
ea66d5323a Merge pull request #2203 from github/lts-upgrade-12.12
Upgrade to LTS 12.12.
2018-10-10 12:18:55 -04:00
Patrick Thomson
8549d70b77 Refactor: remove duplicate code in Analysis.Declaration
The family of functions that extracted a meaningful "identifier" for a
declaration contained a large amount of duplication, owing to
type-specific pattern-matching. Encapsulating this pattern-matching in
a Rule means we can go from six functions to one.
2018-10-10 12:17:10 -04:00
Patrick Thomson
c4561184ff Merge branch 'master' into lts-upgrade-12.12 2018-10-09 16:31:05 -04:00
Patrick Thomson
156f3f6dbc fix ansi-terminal 2018-10-09 15:38:52 -04:00
Timothy Clem
ad3ceb7ab3 Merge pull request #2198 from github/pair-down-symbols-output
Change up what Declarations we identify
2018-10-09 09:28:01 -07:00
Patrick Thomson
0ae629142a License revitalization. 2018-10-09 11:32:42 -04:00
Rob Rix
6ac9b657f0 Merge branch 'master' into pair-down-symbols-output 2018-10-09 10:45:03 -04:00
Patrick Thomson
989d38f27d Update to LTS 12.12.
The major bumps we get here are `algebraic-graphs` v0.2, which
contains a number of speed improvements, and the removal of the
`foundation` as a dependency.
2018-10-09 01:06:55 -04:00
Timothy Clem
ac70c565cc Change up what Declarations we identify 2018-10-05 09:54:57 -07:00
Patrick Thomson
5c3a65338a debug utility 2018-10-05 11:50:54 -04:00