0
Please determine which one is faster
Both produces conflicting results. https://code.sololearn.com/c6Ln9yC8uxHT/?ref=app stm or stm2?
10 RĂ©ponses
+ 1
Is this what your trying to do?:-
https://code.sololearn.com/c1peDJRS36mu/#py
The method of accessing "a called" functions in timeit is shown in the timit module in python.org.
I've changed the 'number'. to 1000......so amend as you see fit.
+ 2
Well, I made this short code for to know the speed of each stm's.
https://code.sololearn.com/cwGi9G1ADG4A/?ref=app
=> stm2 is faster
+ 2
Tricker
I know it, flipping the print functions will nothing happen ;)
+ 2
(I think).....In your code, your not calling the function(s).....your just declaring/ defining the function 1 million times.
+ 1
Change in time cause due to memory usage and processor which is changing continously about million times a second
0
Stm 2 is faster as it takes less time
0
Vishal Gupta have you tried to run multiple times?
0
âĄđ„ đ Baby Hater đ„âĄ
Though there will be no difference in speed because starting from new line or terminating using semi colon results in same performance.
0
rodwynnejones Maybe your code shows that compress is faster. But why there's a big difference in time b/w yours and mine even though both code reflect same process.
I reckon it's a nerdy insight.
0
rodwynnejones That's straightforward right I ponder?
I have forgotten the basics.đ¶