[issue42825] Build libraries with "/OPT:REF" linker optimization on Windows

2021-02-19 Thread Austin Lamb


Austin Lamb  added the comment:

Thanks Steve!

--

___
Python tracker 
<https://bugs.python.org/issue42825>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42825] Build libraries with "/OPT:REF" linker optimization on Windows

2021-02-19 Thread Austin Lamb


Austin Lamb  added the comment:

What are the next steps for this - anything else I can provide, or is someone 
able to take a look at the Pull Request?

Thanks!

--

___
Python tracker 
<https://bugs.python.org/issue42825>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42825] Build libraries with "/OPT:REF" linker optimization on Windows

2021-02-04 Thread Austin Lamb


Austin Lamb  added the comment:

You're right to think that folding is a problem Steve, but thankfully my PR 
does not enable COMDAT folding for that very reason :).

/OPT:ICF enables identical COMDAT folding, but surprisingly-to-me /OPT:REF 
seems to still enable a small amount of  folding (I confirmed with the linker 
dev at Microsoft that this is true).  Thus, just /OPT:REF alone caused test 
failures as there are test cases verifying COMDAT folding didn't occur.

Thus, in my PR I am using /OPT:REF,NOICF to explicitly disable any ICF'ing at 
all and I see no folding occurring anywhere, and those COMDAT-folding-sensitive 
tests pass with that flag.

The dumpbin /exports output is identical after this change.

--

___
Python tracker 
<https://bugs.python.org/issue42825>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42825] Build libraries with "/OPT:REF" linker optimization on Windows

2021-02-01 Thread Austin Lamb


Austin Lamb  added the comment:

Ping - can anyone suggest either how ctypes does its exporting, or suggest 
tests I could run to confirm if this change affects python code?  The entire 
test suite in the repo passes.

--

___
Python tracker 
<https://bugs.python.org/issue42825>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42825] Build libraries with "/OPT:REF" linker optimization on Windows

2021-01-26 Thread Austin Lamb


Austin Lamb  added the comment:

I don't know much about how ctypes exposes stuff - are these exposed as DLL 
exports?  Or if not, how do they get exposed?

The linker will remove things it can't find a callsite for, but it leaves in 
exported functions as of course those are by definition externally callable.  
If ctypes is called another way, I can help confirm whether anything is 
accidentally being stripped out.

--

___
Python tracker 
<https://bugs.python.org/issue42825>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42825] Optimization opportunity on Windows

2021-01-04 Thread Austin Lamb


Change by Austin Lamb :


--
keywords: +patch
pull_requests: +22928
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/24098

___
Python tracker 
<https://bugs.python.org/issue42825>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42825] Optimization opportunity on Windows

2021-01-04 Thread Austin Lamb


New submission from Austin Lamb :

I noticed that CPython and the various libraries built out of the repo aren't 
using the "/OPT:REF" linker optimization on Windows.  This optimization allows 
the linker to throw away dead/unreachable code, resulting in a substantial 
decrease in binary size.  That in turn also reduces the amount of Disk I/O that 
must be done to get these binaries in memory (which can be meaningful on 
spinning hard drives that are still rather common), and the reference set of 
applications using Python.

I'll send a PR for this shortly, just filing the issue to be able to reference 
it in the PR.

--
components: Windows
messages: 384333
nosy: Austin-Lamb, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Optimization opportunity on Windows
type: performance
versions: Python 3.10

___
Python tracker 
<https://bugs.python.org/issue42825>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com