gpt4 book ai didi

r - 注释会减慢R吗?

转载 作者:行者123 更新时间:2023-12-04 08:35:00 26 4
gpt4 key购买 nike

注释会减慢R吗?

关于Python,在StackOverflow上已经问过两次这个问题:

Do comments slow down an interpreted language?
Will excessive commenting of code slow execution?

对于python,答案似乎为“否”。我对这两种语言之间的差异了解不足,无法知道这些答案与R的相关性。

这是关于R中的空白的类似问题。同样,答案似乎是“否”。

does white space slow down processing

最佳答案

对于R,除非我在下面的某个地方犯了错误,否则答案似乎是"is"。

# Time difference of 21.84725 secs
# Time difference of 24.05738 secs

# total.time.2 - total.time.1
#
# Time difference of 2.210126 secs

n <- 280

start.time.1 <- Sys.time()

b <- 2

for(i in 1:n) {
for(j in 1:n) {
for(k in 1:n) {

b <- b + 2 - 1 - 0.75

}
}
}

b

end.time.1 <- Sys.time()

total.time.1 <- end.time.1 - start.time.1
total.time.1


start.time.2 <- Sys.time()

b <- 2

# I wonder whether comments slow down R. Here are some comments. Let's see.
# I wonder whether comments slow down R. Here are some comments. Let's see.
# I wonder whether comments slow down R. Here are some comments. Let's see.
# I wonder whether comments slow down R. Here are some comments. Let's see.
# I wonder whether comments slow down R. Here are some comments. Let's see.
# I wonder whether comments slow down R. Here are some comments. Let's see.
# I wonder whether comments slow down R. Here are some comments. Let's see.
# I wonder whether comments slow down R. Here are some comments. Let's see.
# I wonder whether comments slow down R. Here are some comments. Let's see.
# I wonder whether comments slow down R. Here are some comments. Let's see.
# I wonder whether comments slow down R. Here are some comments. Let's see.
# I wonder whether comments slow down R. Here are some comments. Let's see.
# I wonder whether comments slow down R. Here are some comments. Let's see.
# I wonder whether comments slow down R. Here are some comments. Let's see.
# I wonder whether comments slow down R. Here are some comments. Let's see.
# I wonder whether comments slow down R. Here are some comments. Let's see.
# I wonder whether comments slow down R. Here are some comments. Let's see.
# I wonder whether comments slow down R. Here are some comments. Let's see.
# I wonder whether comments slow down R. Here are some comments. Let's see.
# I wonder whether comments slow down R. Here are some comments. Let's see.
# I wonder whether comments slow down R. Here are some comments. Let's see.
# I wonder whether comments slow down R. Here are some comments. Let's see.
# I wonder whether comments slow down R. Here are some comments. Let's see.
# I wonder whether comments slow down R. Here are some comments. Let's see.
# I wonder whether comments slow down R. Here are some comments. Let's see.
# I wonder whether comments slow down R. Here are some comments. Let's see.
# I wonder whether comments slow down R. Here are some comments. Let's see.


for(i in 1:n) {

# I wonder whether comments slow down R. Here are some comments. Let's see.
# I wonder whether comments slow down R. Here are some comments. Let's see.
# I wonder whether comments slow down R. Here are some comments. Let's see.
# I wonder whether comments slow down R. Here are some comments. Let's see.
# I wonder whether comments slow down R. Here are some comments. Let's see.
# I wonder whether comments slow down R. Here are some comments. Let's see.
# I wonder whether comments slow down R. Here are some comments. Let's see.
# I wonder whether comments slow down R. Here are some comments. Let's see.
# I wonder whether comments slow down R. Here are some comments. Let's see.
# I wonder whether comments slow down R. Here are some comments. Let's see.
# I wonder whether comments slow down R. Here are some comments. Let's see.
# I wonder whether comments slow down R. Here are some comments. Let's see.
# I wonder whether comments slow down R. Here are some comments. Let's see.
# I wonder whether comments slow down R. Here are some comments. Let's see.
# I wonder whether comments slow down R. Here are some comments. Let's see.
# I wonder whether comments slow down R. Here are some comments. Let's see.
# I wonder whether comments slow down R. Here are some comments. Let's see.
# I wonder whether comments slow down R. Here are some comments. Let's see.
# I wonder whether comments slow down R. Here are some comments. Let's see.
# I wonder whether comments slow down R. Here are some comments. Let's see.
# I wonder whether comments slow down R. Here are some comments. Let's see.
# I wonder whether comments slow down R. Here are some comments. Let's see.
# I wonder whether comments slow down R. Here are some comments. Let's see.
# I wonder whether comments slow down R. Here are some comments. Let's see.
# I wonder whether comments slow down R. Here are some comments. Let's see.
# I wonder whether comments slow down R. Here are some comments. Let's see.
# I wonder whether comments slow down R. Here are some comments. Let's see.

for(j in 1:n) {

# I wonder whether comments slow down R. Here are some comments. Let's see.
# I wonder whether comments slow down R. Here are some comments. Let's see.
# I wonder whether comments slow down R. Here are some comments. Let's see.
# I wonder whether comments slow down R. Here are some comments. Let's see.
# I wonder whether comments slow down R. Here are some comments. Let's see.
# I wonder whether comments slow down R. Here are some comments. Let's see.
# I wonder whether comments slow down R. Here are some comments. Let's see.
# I wonder whether comments slow down R. Here are some comments. Let's see.
# I wonder whether comments slow down R. Here are some comments. Let's see.
# I wonder whether comments slow down R. Here are some comments. Let's see.
# I wonder whether comments slow down R. Here are some comments. Let's see.
# I wonder whether comments slow down R. Here are some comments. Let's see.
# I wonder whether comments slow down R. Here are some comments. Let's see.
# I wonder whether comments slow down R. Here are some comments. Let's see.
# I wonder whether comments slow down R. Here are some comments. Let's see.
# I wonder whether comments slow down R. Here are some comments. Let's see.
# I wonder whether comments slow down R. Here are some comments. Let's see.
# I wonder whether comments slow down R. Here are some comments. Let's see.
# I wonder whether comments slow down R. Here are some comments. Let's see.
# I wonder whether comments slow down R. Here are some comments. Let's see.
# I wonder whether comments slow down R. Here are some comments. Let's see.
# I wonder whether comments slow down R. Here are some comments. Let's see.
# I wonder whether comments slow down R. Here are some comments. Let's see.
# I wonder whether comments slow down R. Here are some comments. Let's see.
# I wonder whether comments slow down R. Here are some comments. Let's see.
# I wonder whether comments slow down R. Here are some comments. Let's see.

for(k in 1:n) {

# I wonder whether comments slow down R. Here are some comments. Let's see.
# I wonder whether comments slow down R. Here are some comments. Let's see.
# I wonder whether comments slow down R. Here are some comments. Let's see.
# I wonder whether comments slow down R. Here are some comments. Let's see.
# I wonder whether comments slow down R. Here are some comments. Let's see.
# I wonder whether comments slow down R. Here are some comments. Let's see.
# I wonder whether comments slow down R. Here are some comments. Let's see.
# I wonder whether comments slow down R. Here are some comments. Let's see.
# I wonder whether comments slow down R. Here are some comments. Let's see.
# I wonder whether comments slow down R. Here are some comments. Let's see.
# I wonder whether comments slow down R. Here are some comments. Let's see.
# I wonder whether comments slow down R. Here are some comments. Let's see.
# I wonder whether comments slow down R. Here are some comments. Let's see.
# I wonder whether comments slow down R. Here are some comments. Let's see.
# I wonder whether comments slow down R. Here are some comments. Let's see.
# I wonder whether comments slow down R. Here are some comments. Let's see.
# I wonder whether comments slow down R. Here are some comments. Let's see.
# I wonder whether comments slow down R. Here are some comments. Let's see.
# I wonder whether comments slow down R. Here are some comments. Let's see.
# I wonder whether comments slow down R. Here are some comments. Let's see.
# I wonder whether comments slow down R. Here are some comments. Let's see.
# I wonder whether comments slow down R. Here are some comments. Let's see.
# I wonder whether comments slow down R. Here are some comments. Let's see.
# I wonder whether comments slow down R. Here are some comments. Let's see.
# I wonder whether comments slow down R. Here are some comments. Let's see.
# I wonder whether comments slow down R. Here are some comments. Let's see.

b <- b + 2 - 1 - 0.75

# I wonder whether comments slow down R. Here are some comments. Let's see.
# I wonder whether comments slow down R. Here are some comments. Let's see.
# I wonder whether comments slow down R. Here are some comments. Let's see.
# I wonder whether comments slow down R. Here are some comments. Let's see.
# I wonder whether comments slow down R. Here are some comments. Let's see.
# I wonder whether comments slow down R. Here are some comments. Let's see.
# I wonder whether comments slow down R. Here are some comments. Let's see.
# I wonder whether comments slow down R. Here are some comments. Let's see.
# I wonder whether comments slow down R. Here are some comments. Let's see.
# I wonder whether comments slow down R. Here are some comments. Let's see.
# I wonder whether comments slow down R. Here are some comments. Let's see.
# I wonder whether comments slow down R. Here are some comments. Let's see.
# I wonder whether comments slow down R. Here are some comments. Let's see.
# I wonder whether comments slow down R. Here are some comments. Let's see.
# I wonder whether comments slow down R. Here are some comments. Let's see.
# I wonder whether comments slow down R. Here are some comments. Let's see.
# I wonder whether comments slow down R. Here are some comments. Let's see.
# I wonder whether comments slow down R. Here are some comments. Let's see.
# I wonder whether comments slow down R. Here are some comments. Let's see.
# I wonder whether comments slow down R. Here are some comments. Let's see.
# I wonder whether comments slow down R. Here are some comments. Let's see.
# I wonder whether comments slow down R. Here are some comments. Let's see.
# I wonder whether comments slow down R. Here are some comments. Let's see.
# I wonder whether comments slow down R. Here are some comments. Let's see.
# I wonder whether comments slow down R. Here are some comments. Let's see.
# I wonder whether comments slow down R. Here are some comments. Let's see.

}
}
}

b

end.time.2 <- Sys.time()

total.time.2 <- end.time.2 - start.time.2

total.time.1
total.time.2

total.time.2 - total.time.1

关于r - 注释会减慢R吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22971888/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com