sapling/mercurial/executionmodel.py
Kostia Balytskyi b168277429 entrypoint: avoid importing heavy modules before demandimport is in play
Summary:
Non-demandimport-based importing of `util` costs ~0.3s. Replacing it with
importing `posix` or `windows` reduces the cost to ~0.1s, but having a dedicated
module for this one purpose, setting the `executedfrombinary` flag, just shaves
the cost completely off.

Reviewed By: mitrandir77

Differential Revision: D10478778

fbshipit-source-id: e69e92351c1b9b3ab23c291bf8b50f9e3af1f13f
2018-10-23 08:27:35 -07:00

12 lines
327 B
Python

# Copyright 2018-present Facebook. All Rights Reserved.
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
executedfrombinary = False
def setbinaryexecution(isbinary=False):
global executedfrombinary
executedfrombinary = isbinary