avatar
G*a
1
it's such a happy thing improve the speed of my crap code when dealing with
that huge dataset. anyone knows any particular place talking about this type
of similar topics?
avatar
w*r
2
yes, that sounds terrific, creating object is resource consuming, avoiding
create too many instance is very important, however, sometime it is not quite
easy in java as the language does not provide lightweighted struct mechanism.
for loop is a controversial issue, using the for loop can help compiler to
inline your code, hoewver, reckless design for loop without checking the real
boundary of loop is a waste of system resource. i would say if you know that
your loop will definitely executed for

【在 G*********a 的大作中提到】
: it's such a happy thing improve the speed of my crap code when dealing with
: that huge dataset. anyone knows any particular place talking about this type
: of similar topics?

avatar
G*a
3
exactly! To segment the huge data into smaller chunks at beginning also helps.
It's really important to control the memory usage, once my crab code crash my
computer when i run it on a large microarray data.

from
to
of

【在 w*r 的大作中提到】
: yes, that sounds terrific, creating object is resource consuming, avoiding
: create too many instance is very important, however, sometime it is not quite
: easy in java as the language does not provide lightweighted struct mechanism.
: for loop is a controversial issue, using the for loop can help compiler to
: inline your code, hoewver, reckless design for loop without checking the real
: boundary of loop is a waste of system resource. i would say if you know that
: your loop will definitely executed for

avatar
w*r
4
for these codes, they should compile the same way, compiler may unrolling the
body of the loop multiple times to eliminate the testing at the end/begnning
of the loop,
other sittuations may be differnet,
t=0
while(t<1000){
if(j){
then c[t]=j(p)
t++
}
else{
c=f(p,t)
t++
}
}
if compiler is smart enough, it may figure out this simple program, if the
optimization code is not good enough, it may turn into different structure, A
good c
avatar
G*a
5
exactly! To segment the huge data into smaller chunks at beginning also helps.
It's really important to control the memory usage, once my crab code crash my
computer when i run it on a large microarray data.

from
to
of

【在 w*r 的大作中提到】
: for these codes, they should compile the same way, compiler may unrolling the
: body of the loop multiple times to eliminate the testing at the end/begnning
: of the loop,
: other sittuations may be differnet,
: t=0
: while(t<1000){
: if(j){
: then c[t]=j(p)
: t++
: }

avatar
G*a
6
oh, sorry, what i refered to was something like this situation: to go through
an ArrayList object, you can use either "for loop" or an "iterator" for this
ArrayList. i think iteraotor is faster than for loop here.
avatar
w*r
7
dealing with large dataset is always a difficult issue. situations varies from
on to the other I do not think there will be any sort of universal/generic
solution to optimize the performance under this scenario. The no1 rule is to
go ahead find the complexity of your code. Try to identify the possible way to
reduce the complexity of your code. Try to be conservative on the memory
usage of your code. Deposite the result of your compuration for each block of
data out of your program memory as earl

【在 G*********a 的大作中提到】
: it's such a happy thing improve the speed of my crap code when dealing with
: that huge dataset. anyone knows any particular place talking about this type
: of similar topics?

avatar
G*a
8
i think iterator is much faster than for loop, whenever it can be used.

quite
.
real
,

【在 w*r 的大作中提到】
: yes, that sounds terrific, creating object is resource consuming, avoiding
: create too many instance is very important, however, sometime it is not quite
: easy in java as the language does not provide lightweighted struct mechanism.
: for loop is a controversial issue, using the for loop can help compiler to
: inline your code, hoewver, reckless design for loop without checking the real
: boundary of loop is a waste of system resource. i would say if you know that
: your loop will definitely executed for

avatar
w*r
9
streamlize your data into a feeder object(if your computation can be seperated
), feed the data to multiple light weighted computing thread and have a result
deposite controller to stream your data out. Carefully handle the number of
your computation threads so that the computation thread can be constantly
busying with its task without been held by the process of data processing.
Data Feeder (data pre-process/feed to thread) --> (computation thread)*n -->
result deposite bank(handle muliple requ

【在 G*********a 的大作中提到】
: exactly! To segment the huge data into smaller chunks at beginning also helps.
: It's really important to control the memory usage, once my crab code crash my
: computer when i run it on a large microarray data.
:
: from
: to
: of

avatar
g*g
10
I don't see any difference.
between
i=0;
while(ii++;
}
and for(i=0;i}
To my understanding, they would be compiled to the same assembly.

【在 G*********a 的大作中提到】
: i think iterator is much faster than for loop, whenever it can be used.
:
: quite
: .
: real
: ,

avatar
w*r
11
yep

【在 G*********a 的大作中提到】
: i think iterator is much faster than for loop, whenever it can be used.
:
: quite
: .
: real
: ,

avatar
G*a
12
oh, sorry, what i refered to was something like this situation: to go through
an ArrayList object, you can use either "for loop" or an "iterator" for this
ArrayList. i think iteraotor is faster than for loop here.

【在 g*****g 的大作中提到】
: I don't see any difference.
: between
: i=0;
: while(i: i++;
: }
: and for(i=0;i: }
: To my understanding, they would be compiled to the same assembly.

avatar
g*g
13
I don't see any difference.
between
i=0;
while(ii++;
}
and for(i=0;i}
To my understanding, they would be compiled to the same assembly.

【在 G*********a 的大作中提到】
: i think iterator is much faster than for loop, whenever it can be used.
:
: quite
: .
: real
: ,

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。