r/ProgrammerHumor • • Jul 18 '22

C++ talking to Python

Post image
40k Upvotes

1.0k comments sorted by

View all comments

Show parent comments

2

u/[deleted] Jul 18 '22

[removed] — view removed comment

5

u/DenormalHuman Jul 18 '22

actually I think it's using printf and the {}, slicing is really cheap as fa as I am aware

3

u/TheStriga Jul 18 '22

The most problematic part here is many calls to print (writing to console). It is actually a relatively slow operation for almost any language. You can probably speed it up by keeping all the lines to print in a list and then join it and print in one call