-
Notifications
You must be signed in to change notification settings - Fork 201
Open
Description
Try the following code to test speed of print() vs ic():
from icecream import ic
from time import time
start = time()
for i in range(1000):
print("i:", i)
stop = time()
elapsed = stop - start
start = time()
for i in range(1000):
ic(i)
stop = time()
elapsed2 = stop - start
print(elapsed)
print(elapsed2)
print(f"print() is {elapsed2 / elapsed} times faster than ic()")
I found that print is 68 times faster!
How to make it faster? Why is it so slow? Is it because of the coloring?
Metadata
Metadata
Assignees
Labels
No labels