[pypy-dev] Syscall Interface slowness

Carl Friedrich Bolz-Tereick cfbolz at gmx.de
Sun May 2 10:06:12 EDT 2021


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
>



More information about the pypy-dev mailing list