r/shittyprogramming • • Apr 25 '19

<wrong_sub>this</wrong_sup> rEeeEEeeeE

Post image
436 Upvotes

29 comments sorted by

View all comments

Show parent comment

1

u/[deleted] Apr 26 '19

puts isn't slower than printf lmao, it does a strlen() and then just writes it directly to stdout, there's not much you could do faster EXCEPT maybe using fwrite and using a constant string length

1

u/your_mom_on_drugs Apr 26 '19

I thought it was weird but I trusted him ;_;

1

u/[deleted] Apr 26 '19

Atleast in glibc it just calls strlen and and then does a write syscall