[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 

___
___
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 Steve Dower


Steve Dower  added the comment:

The ping was enough. Thanks!

--
assignee:  -> steve.dower
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
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 Steve Dower


Steve Dower  added the comment:


New changeset b4af629f4d4868ef74ee298d66259fae78c7fd89 by Austin Lamb in branch 
'master':
bpo-42825: Enable /OPT:REF (GH-24098)
https://github.com/python/cpython/commit/b4af629f4d4868ef74ee298d66259fae78c7fd89


--

___
Python tracker 

___
___
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 

___
___
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 John Rey Osano


Change by John Rey Osano :


--
components: +C API, Extension Modules, IO
type: performance -> enhancement

___
Python tracker 

___
___
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 

___
___
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 Steve Dower


Steve Dower  added the comment:

On Windows it should only affect non-exported functions. Comparing "dumpbin 
/exports" output will tell you whether anything has changed there.

The bigger concern is if it merges identical functions that are compared by 
function pointer. I know we've had issues with that in the past, and I forget 
how we've dealt with that. I thought OPT:REF would do this optimisation too 
(though ISTR it's known as COMDAT folding and may have its own option).

--

___
Python tracker 

___
___
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 

___
___
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 

___
___
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-08 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

The PR says that this deletes "uncalled code".  I imagine that this is safe for 
a .exe.  But for a .dll?  As i understand it, one can, from python code, access 
any function via ctypes, so it seems to me that there is no way for the linker 
to know which callable functions in a .dll can be safely deleted.  Am I missing 
something?

--
nosy: +terry.reedy

___
Python tracker 

___
___
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-05 Thread Ammar Askar


Change by Ammar Askar :


--
nosy: +eryksun
title: Optimization opportunity on Windows -> Build libraries with "/OPT:REF" 
linker optimization on Windows

___
Python tracker 

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