This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2013年04月17日 18:40 by pitrou, last changed 2022年04月11日 14:57 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| perflog.txt | pitrou, 2013年04月17日 18:40 | |||
| lto_flag.patch | christian.heimes, 2013年04月18日 13:05 | review | ||
| Messages (17) | |||
|---|---|---|---|
| msg187192 - (view) | Author: Antoine Pitrou (pitrou) * (Python committer) | Date: 2013年04月17日 18:40 | |
Ubuntu's system Python 3.3 shows consistently better performance than a vanilla Python 3.3: around 10-15% faster in general (see attached benchmark numbers). If this can be attributed to different compilation options, it would be nice to backport those options to our standard build config. |
|||
| msg187193 - (view) | Author: Matthias Klose (doko) * (Python committer) | Date: 2013年04月17日 18:45 | |
most of that can be attributed to the pgo build, which is upstream for a long time. the second thing to do is to build with lto, and see what speedups you get in addition. and it certainly helps to build the interpreter statically (without --enable-shared). but thanks to confirming my own experience ;) |
|||
| msg187245 - (view) | Author: Christian Heimes (christian.heimes) * (Python committer) | Date: 2013年04月18日 13:05 | |
Here is a patch for -flto. You need to run autoconf to re-generate configure, too. |
|||
| msg187246 - (view) | Author: Matthias Klose (doko) * (Python committer) | Date: 2013年04月18日 13:24 | |
the proposed patch is wrong. when linking with -flto, you should pass all the relevant CFLAGS to the linker as well. Also pass -fuse-linker-plugin. and this should be an opt-in, not the default. Depending on the architecture and the compiler version, -flto is not as stable as you want it to be. and last, this ends up as the default for building third party extensions too, which again, I think should be an opt-in. |
|||
| msg248993 - (view) | Author: Stefan Behnel (scoder) * (Python committer) | Date: 2015年08月22日 19:27 | |
Issue 24915 suggests PGO and comes with an actual patch. I suggest rejecting this ticket as too broad. |
|||
| msg248994 - (view) | Author: Antoine Pitrou (pitrou) * (Python committer) | Date: 2015年08月22日 19:29 | |
LTO (Link-Time Optimization) is not the same as PGO, though I guess it can take advantage of PGO for its heuristics. |
|||
| msg249103 - (view) | Author: Raymond Hettinger (rhettinger) * (Python committer) | Date: 2015年08月25日 03:00 | |
I would like the see LTO enabled. The intermodule calls to code in abstract.c would become less expensive. |
|||
| msg249253 - (view) | Author: Antoine Pitrou (pitrou) * (Python committer) | Date: 2015年08月27日 19:08 | |
Note this patch is likely wrong, as it doesn't add the optimization options to the linker invocation. According to the gcc does, """To use the link-time optimizer, -flto and optimization options should be specified at compile time and during the final link""". So probably $OPT should be added to $PY_LDFLAGS. |
|||
| msg249260 - (view) | Author: Antoine Pitrou (pitrou) * (Python committer) | Date: 2015年08月27日 21:09 | |
For the record, the gain for LTO+PGO (with "-flto -O3") over PGO alone seems to be between 0% and 10% for most benchmarks. |
|||
| msg249261 - (view) | Author: Antoine Pitrou (pitrou) * (Python committer) | Date: 2015年08月27日 21:10 | |
You can test for yourself by passing `CFLAGS="-flto -O3" LDFLAGS="-flto -O3"` to ./configure (using gcc). |
|||
| msg251304 - (view) | Author: STINNER Victor (vstinner) * (Python committer) | Date: 2015年09月22日 10:28 | |
> For the record, the gain for LTO+PGO (with "-flto -O3") over PGO alone seems to be between 0% and 10% for most benchmarks. Hum, does it make sense to enable LTO without PGO? |
|||
| msg251305 - (view) | Author: Antoine Pitrou (pitrou) * (Python committer) | Date: 2015年09月22日 10:31 | |
> Hum, does it make sense to enable LTO without PGO? Probably not. By the way, I now have a small ARM system to play with, and there the gain of LTO+PGO over PGO alone is around 10%. Also note LTO can make compilation times much longer (it's the linking step actually, which can take minutes). |
|||
| msg251335 - (view) | Author: Matthias Klose (doko) * (Python committer) | Date: 2015年09月22日 17:44 | |
On 22.09.2015 12:31, Antoine Pitrou wrote: > Also note LTO can make compilation times much longer (it's the linking step actually, which can take minutes). use -flto=jobserver |
|||
| msg251608 - (view) | Author: Terry J. Reedy (terry.reedy) * (Python committer) | Date: 2015年09月25日 20:26 | |
#24915 is about adding pgo and has a slew of patches. |
|||
| msg256281 - (view) | Author: Alecsandru Patrascu (alecsandru.patrascu) * | Date: 2015年12月12日 12:05 | |
Hi, I added a dedicated issue just for LTO only when using GCC and CLANG (http://bugs.python.org/issue25702), that works well with PGO also. |
|||
| msg258629 - (view) | Author: Zachary Ware (zach.ware) * (Python committer) | Date: 2016年01月19日 22:37 | |
PGO is available as `make profile-opt`, LTO has a patch in issue25702. Are there any other interesting options worth investigating? |
|||
| msg324898 - (view) | Author: Zachary Ware (zach.ware) * (Python committer) | Date: 2018年09月09日 19:05 | |
After 2.5 years without response, I think the answer is probably "no" :) |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:57:44 | admin | set | github: 61981 |
| 2018年09月09日 19:05:34 | zach.ware | set | status: pending -> closed resolution: fixed messages: + msg324898 stage: resolved |
| 2016年01月19日 23:00:27 | r.david.murray | set | status: open -> pending |
| 2016年01月19日 22:52:56 | r.david.murray | set | status: pending -> open nosy: + r.david.murray |
| 2016年01月19日 22:37:50 | zach.ware | set | status: open -> pending nosy: + zach.ware messages: + msg258629 |
| 2015年12月12日 12:05:05 | alecsandru.patrascu | set | nosy:
+ alecsandru.patrascu messages: + msg256281 |
| 2015年09月25日 20:26:52 | terry.reedy | set | nosy:
+ terry.reedy messages: + msg251608 |
| 2015年09月22日 17:44:41 | doko | set | messages: + msg251335 |
| 2015年09月22日 10:31:19 | pitrou | set | messages: + msg251305 |
| 2015年09月22日 10:28:13 | vstinner | set | nosy:
+ vstinner messages: + msg251304 |
| 2015年08月27日 21:10:10 | pitrou | set | messages: + msg249261 |
| 2015年08月27日 21:09:16 | pitrou | set | messages: + msg249260 |
| 2015年08月27日 19:08:50 | pitrou | set | messages: + msg249253 |
| 2015年08月25日 03:00:19 | rhettinger | set | nosy:
+ rhettinger messages: + msg249103 |
| 2015年08月22日 19:29:52 | pitrou | set | messages: + msg248994 |
| 2015年08月22日 19:27:53 | scoder | set | nosy:
+ scoder messages: + msg248993 |
| 2014年05月13日 22:19:17 | skrah | set | nosy:
- skrah |
| 2013年12月17日 18:24:34 | skrah | set | nosy:
+ skrah |
| 2013年04月18日 13:24:13 | doko | set | messages: + msg187246 |
| 2013年04月18日 13:05:43 | christian.heimes | set | files:
+ lto_flag.patch nosy: + christian.heimes messages: + msg187245 keywords: + patch |
| 2013年04月17日 18:45:41 | doko | set | messages: + msg187193 |
| 2013年04月17日 18:40:08 | pitrou | create | |