[R] compiling functions....

akshay kulkarni @k@h@y_e4 @ending from hotm@il@com
Thu Jun 21 12:28:03 CEST 2018

dear members,
                            I a Day Trader based in INDIA. I use R for my research. I have a function ygusa(snlq,snlcqn) which takes 208 stocks and returns 4 best stocks for the next day(snlq is the list of 208 stocks and snlcqn is their names). However, the execution time is around 2 hrs, making it hard for me.

I recently read in the internet that you can precompile the code in R to make it run faster. Also that you can enable JIT(just in time compilation) from your R session automatically. I came to know that R 3.4.x has JIT enabled in it by default. Is it true? Is it also true that even after enabling JIT in R 3.4.x, the first run of a function is not Byte compiled?

So when I start my R session, download the data, and run ygusa(snlq,snlcqn), it is not byte compiled and therefore it is very slow? Will including the following lines in ygusa solve my problem:
> require(compiler)
> enableJIT(3)


Also, instead of compiling the function ygusa every time I run it, can I compile it once and store it, and run that compiled file instead of ygusa(snlq,snlcqn)?

Can you point me to some online resources that can help on this issue?

very many thanks for your time and effort...
Yours sincerely,

	[[alternative HTML version deleted]]

More information about the R-help mailing list