consolidate ServerTypeCheck.do_naming 1/3
commita13f695abafed3bdb3889f7998e68d1d2cbccc82
authorLucian Wischik <ljw@fb.com>
Tue, 14 Sep 2021 06:39:51 +0000 (13 23:39 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Tue, 14 Sep 2021 06:42:27 +0000 (13 23:42 -0700)
tree4144370eb10bbde8cde12da1090ab584d36a930d
parentf0c0961a1d26e6c010af4d003c6d7008157e73a2
consolidate ServerTypeCheck.do_naming 1/3

Summary:
There are three naming-tables being updated: forward, reverse, and Typing_deps.Files.ifiles. The structure of this code makes it hard to see that they're all being updated. I'm refactoring ServerTypeCheck to make it more apparent: I'm putting all the stuff relating to naming tables in "do_naming", and moving the redecl stuff out.

This diff slightly changes logging:
1. The command-line spinner used to display "Parsing" while it was parsing, and updating two of the naming tables, and then "resolving symbol references" while updating the third. Now it displays "updating naming tables" for all three.
2. Telemetry json used to be naming_update_start, naming_update_end, naming_start, naming_end, naming_end_heap_size. I've switched the meaning of "naming_start" to now be at the start (where naming_update_start used to be). For the moment this diff has removed the internal naming datapoints. I'll restore them.
3. Server log used to say Begin Updating deps / End updating deps [duration] / Begin Naming / End Naming [duration]. In this diff it currently just says "Begin updating naming tables / End updating naming tables [duration]". I'll add more in future diffs.
4. The time taken to stream errors is no longer counted towards naming time. The time taken to compute redecls based on naming errors is now counted towards redecl-time, rather than naming time.

Differential Revision: D30882550

fbshipit-source-id: ca772402a539e6d4a4ab4893773caefe51b7ab37
hphp/hack/src/server/serverTypeCheck.ml