Re: Syscall Interface slowness

Carl Friedrich Bolz-Tereick <[email protected]>
Newsgroups gmane.comp.python.pypy
Message-ID <[email protected]>
Ah, I found one problem: your script uses .writelines with a string as
the argument. writelines usually takes an iterator (like a list) but it
will also work with a string argument, and then do:

for char in s:
     w.write(char)

if I replace the writelines(...) with a .write(...) it becomes much
faster, both on cpython and pypy.

CF

On 5/2/21 12:49 AM, Emre Yavuz wrote:
> Hi Carl,
>
> Sorry I couldn’t receive your message (probably something wrong in my
> mail configuration) but I saw the message from digest.
>
> I created self contained program for this example. I am using “writelines”
>
>
> *That’s paste bin link to program:*
> https://pastebin.com/D6auMcwN <https://pastebin.com/D6auMcwN>
>
> *Command line:*
> (devpy) emreyavuz:tmp emreyavuz$ python3 test-writer
> Time has been spend for copying data 28 secs
> (devpy) emreyavuz:tmp emreyavuz$ pypy3 test-writer
> Time has been spend for copying data 118 secs
>
>
> Best,
> Emre Yavuz
>

_______________________________________________
pypy-dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-dev
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.