All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ming Liu" <liu.ming50@gmail.com>
To: meta-virtualization@lists.yoctoproject.org
Cc: stefan.agner@toradex.com, simon.bueler@toradex.com,
	Ming Liu <liu.ming50@gmail.com>
Subject: [meta-virtualization][PATCH 2/2] python3-docker-compose: import fastentrypoints
Date: Sat,  1 Feb 2020 18:47:20 +0100	[thread overview]
Message-ID: <1580579240-12882-2-git-send-email-liu.ming50@gmail.com> (raw)
In-Reply-To: <1580579240-12882-1-git-send-email-liu.ming50@gmail.com>

From: Ming Liu <liu.ming50@gmail.com>

The docker-compose project is using console_scripts which hence imports
pkg_resources which is very slow at starting time, see:
https://github.com/pypa/setuptools/issues/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>
---
 .../0001-setup.py-import-fastentrypoints.patch     | 28 ++++++++++++++++++++++
 .../python3-docker-compose_1.25.0.bb               |  6 ++++-
 2 files changed, 33 insertions(+), 1 deletion(-)
 create mode 100644 recipes-containers/docker-compose/files/0001-setup.py-import-fastentrypoints.patch

diff --git a/recipes-containers/docker-compose/files/0001-setup.py-import-fastentrypoints.patch b/recipes-containers/docker-compose/files/0001-setup.py-import-fastentrypoints.patch
new file mode 100644
index 0000000..df613e8
--- /dev/null
+++ b/recipes-containers/docker-compose/files/0001-setup.py-import-fastentrypoints.patch
@@ -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
+
diff --git a/recipes-containers/docker-compose/python3-docker-compose_1.25.0.bb b/recipes-containers/docker-compose/python3-docker-compose_1.25.0.bb
index 36e2417..ba35c49 100644
--- a/recipes-containers/docker-compose/python3-docker-compose_1.25.0.bb
+++ b/recipes-containers/docker-compose/python3-docker-compose_1.25.0.bb
@@ -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 \
-- 
2.7.4


  reply	other threads:[~2020-02-01 17:47 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-01 17:47 [meta-virtualization][PATCH 1/2] python3-fastentrypoints: add recipe Ming Liu
2020-02-01 17:47 ` Ming Liu [this message]
2020-02-01 18:32 ` Tim Orling
2020-02-01 18:40   ` Bruce Ashfield
2020-02-03 22:11 ` Bruce Ashfield

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1580579240-12882-2-git-send-email-liu.ming50@gmail.com \
    --to=liu.ming50@gmail.com \
    --cc=meta-virtualization@lists.yoctoproject.org \
    --cc=simon.bueler@toradex.com \
    --cc=stefan.agner@toradex.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.