Skip to content

Commit

Permalink
python3-docker-compose: import fastentrypoints
Browse files Browse the repository at this point in the history
Source: meta-virtualization
MR: 00000
Type: Integration
Disposition: Merged from meta-virtualization
ChangeID: c1bc396
Description:

The docker-compose project is using console_scripts which hence imports
pkg_resources which is very slow at starting time, see:
pypa/setuptools#510

This could be workaround by importing fastentrypoints module.

Some tests:

Before the patch, on a colibri-imx8x machine:

$ time docker-compose
```

real	0m5.108s
user	0m4.761s
sys	0m0.272s
```

After the patch, on a colibri-imx8x machine:

$ time docker-compose
```

real	0m3.526s
user	0m3.249s
sys	0m0.235s
```

Have verified the patch with:
https://docs.docker.com/compose/gettingstarted

Signed-off-by: Ming Liu <liu.ming50@gmail.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
Signed-off-by: Jeremy Puhlman <jpuhlman@mvista.com>
  • Loading branch information
liuming50 authored and jpuhlman committed Feb 4, 2020
1 parent 290997a commit 36a5b6f
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
From f3a22f0f14a4b3313e6405dfb6c97df949493a34 Mon Sep 17 00:00:00 2001
From: Ming Liu <liu.ming50@gmail.com>
Date: Thu, 30 Jan 2020 17:22:19 +0100
Subject: [PATCH] setup.py: import fastentrypoints

Upstream-Status: Inappropriate [OE specific configuration]

Signed-off-by: Ming Liu <liu.ming50@gmail.com>
---
setup.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/setup.py b/setup.py
index ad57969..3cccffc 100644
--- a/setup.py
+++ b/setup.py
@@ -12,7 +12,7 @@ import sys
import pkg_resources
from setuptools import find_packages
from setuptools import setup
-
+import fastentrypoints

def read(*parts):
path = os.path.join(os.path.dirname(__file__), *parts)
--
2.7.4

Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ inherit pypi setuptools3
SRC_URI[md5sum] = "275b32cffdad6b9816dc8b4c7e55600a"
SRC_URI[sha256sum] = "2c5fcbfd3ff445b6f3eebb549cb167ef1d8f70c5806aab8f309fc8fa74cd977e"

SRC_URI += "file://0001-setup.py-remove-maximum-version-requirements.patch"
SRC_URI += "file://0001-setup.py-remove-maximum-version-requirements.patch \
file://0001-setup.py-import-fastentrypoints.patch \
"

DEPENDS += "${PYTHON_PN}-fastentrypoints-native"

RDEPENDS_${PN} = "\
${PYTHON_PN}-cached-property \
Expand Down

0 comments on commit 36a5b6f

Please sign in to comment.