[issue41340] Not very good strcpy implementation in cpython/Python/strdup.c

2020-07-26 Thread Inada Naoki


Inada Naoki  added the comment:


New changeset 5798f787779006a94a55ec74a86da4627de90146 by wasiher in branch 
'master':
bpo-41340: Removed fallback implementation for strdup (GH-21634)
https://github.com/python/cpython/commit/5798f787779006a94a55ec74a86da4627de90146


--

___
Python tracker 

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



[issue41340] Not very good strcpy implementation in cpython/Python/strdup.c

2020-07-26 Thread Inada Naoki


Change by Inada Naoki :


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



[issue41340] Not very good strcpy implementation in cpython/Python/strdup.c

2020-07-26 Thread fj92f3jj923f923


fj92f3jj923f923  added the comment:

Created a new PR for removal of strdup (Hope it is correct)
https://github.com/python/cpython/pull/21634
Closed old one

--

___
Python tracker 

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



[issue41340] Not very good strcpy implementation in cpython/Python/strdup.c

2020-07-26 Thread fj92f3jj923f923


Change by fj92f3jj923f923 :


--
pull_requests: +20776
pull_request: https://github.com/python/cpython/pull/21634

___
Python tracker 

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



[issue41340] Not very good strcpy implementation in cpython/Python/strdup.c

2020-07-26 Thread fj92f3jj923f923


fj92f3jj923f923  added the comment:

I can give a try with removing
Please, wait
Thanks everyone for giving a chance to make a PR :)

--

___
Python tracker 

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



[issue41340] Not very good strcpy implementation in cpython/Python/strdup.c

2020-07-26 Thread Guido van Rossum


Change by Guido van Rossum :


--
nosy:  -gvanrossum

___
Python tracker 

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



[issue41340] Not very good strcpy implementation in cpython/Python/strdup.c

2020-07-26 Thread Guido van Rossum

Guido van Rossum  added the comment:

There’s probably also something in configure.in that can switch this on.

--

___
Python tracker 

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



[issue41340] Not very good strcpy implementation in cpython/Python/strdup.c

2020-07-25 Thread Inada Naoki


Inada Naoki  added the comment:

@fj92f3jj923f923 Would you update the PR to remove the strdup.c?

--

___
Python tracker 

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



[issue41340] Not very good strcpy implementation in cpython/Python/strdup.c

2020-07-24 Thread hai shi


hai shi  added the comment:

What's change for the performance benchmark?

--
nosy: +shihai1991

___
Python tracker 

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



[issue41340] Not very good strcpy implementation in cpython/Python/strdup.c

2020-07-24 Thread Guido van Rossum

Guido van Rossum  added the comment:

Either remove it or close this issue as won’t fix.

--
nosy: +gvanrossum

___
Python tracker 

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



[issue41340] Not very good strcpy implementation in cpython/Python/strdup.c

2020-07-20 Thread Inada Naoki


Inada Naoki  added the comment:

Can we just remove strdup.c? How about hypot.c?

--
nosy: +inada.naoki

___
Python tracker 

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



[issue41340] Not very good strcpy implementation in cpython/Python/strdup.c

2020-07-20 Thread fj92f3jj923f923


fj92f3jj923f923  added the comment:

Got it.
But the fix is quite easy as I see, and does not require much affort too.

--

___
Python tracker 

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



[issue41340] Not very good strcpy implementation in cpython/Python/strdup.c

2020-07-19 Thread Benjamin Peterson


Benjamin Peterson  added the comment:

I don't think we need to spend much effort on this implementation, since it 
will only be used if the system libc doesn't have a strdup already.

--
nosy: +benjamin.peterson

___
Python tracker 

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



[issue41340] Not very good strcpy implementation in cpython/Python/strdup.c

2020-07-19 Thread fj92f3jj923f923


Change by fj92f3jj923f923 :


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

___
Python tracker 

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



[issue41340] Not very good strcpy implementation in cpython/Python/strdup.c

2020-07-19 Thread fj92f3jj923f923


New submission from fj92f3jj923f923 :

Hi, all!

strdup implementation inside cpython/Python/strdup.c is not the best one.
It calls strlen + strcpy, which is the same as calling strlen twice + memcpy.
So I replaced it by the call of strlen + memcpy.

It is easy to look any implementation in any library.
Here for example:
https://code.woboq.org/userspace/glibc/string/strdup.c.html

So I fixed it here:
https://github.com/python/cpython/pull/21544

--
components: C API
messages: 373955
nosy: fj92f3jj923f923
priority: normal
severity: normal
status: open
title: Not very good strcpy implementation in cpython/Python/strdup.c
type: performance
versions: Python 3.10

___
Python tracker 

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