Meteor run performance - meteor

Is there anyway to make the 'meteor' command or also known as 'meteor run' command in the console execute faster to run the app when developing? When I do little changes, I have to ctrl + C in the command line and meteor run (I do this because sometimes the hot code push takes time to take effect after I put the code so just ctrl + C and run it again) and it takes up like a min or two to start running again cause the app is getting big. Is there any way to make it fast while on development or there's nothing I can do about it?

One thing that I've seen cause this is files in the /public directory. If you store more than a small number of images or other files in there, it can make the app take a really long time to start up and even crash on hot code pushes.

Related

Stop submitted lines of code from running

I'm running a long R script, which takes 2 or 3 days to finish. I accidentally run another script, which, if it works as R usually does, will go in some queue and R will run it as soon as the first script is over. I need to stop that, as it would compromise the results from the first script. Is there a visible queue or any other way to stop R from running some code?
I'm working on an interactive session in R studio, on windows 10.
Thanks a lot for any help!
Assuming you're running in console (or interactive session in R studio, that's undetermined from your question) and that what you did was sourcing a script/pasting code and while it was running pasting another chunck of code:
What is ongoing is that you pushed data into R process input stream, it's a buffered input, so it will run each line once the previous line call has ended and free the process.
There's no easy way to play with an input buffer, that's R internal input/output system and mostly it's the Operating system which have those information in cache for now.
Asking R itself is not possible as it already has this buffer to read, any new command would go after.
Last chance thing: If you can spot your another chunck of code starting in your console, you can try pressing the esc key to stop the code running.
You may try messing with the process buffers with procexp but there's a fair chance to just make your R session segfault anyway.
To avoid that in the future, use scripts and run them on the command line separately with Rscript (present in R bin directory under windows too despite the link pointing to a linux manpage).
This would create one session per script and allow to kill them independently. That said if they both write to the same place (database, a file would create an error if accessed by two process) that won't prevent data corruption.
I am guessing OP has below problem:
# my big code, running for a long time
Sys.sleep(10); print("hello 1")
# other big code I dropped in console while R was still busy with above code
print("hello 2")
If this is the case, I don't think it is possible to stop the 2nd process from running.

R Server - Resuming R Session - message hanging or taking 15+min

I frequently work on a R-server environment. However, whenever come back to my work following the last working day, the system often gets stuck with 'resuming r session'. This might take upwards of 5-15min. I try to terminate R or restart R but often this doesn't really do anything.
I'm looking for a work-around as it is very frustrating to go to the R-server URL and to have to wait forever to get started again. IDEALLY, I'd be able to pick up right where I left off. However, if this can't be done, I guess that is ok….
I was looking around at the folder structure and I noticed that there is a folder called "Suspended-R-Session".
Within this folder are a few files such as:
'options',
'lib paths',
'history',
'environment_vars',
'environment',
and 'settings'.
Should I be deleting these files in order to speed up load time???
As described in this link https://support.rstudio.com/hc/en-us/community/posts/200638878-resuming-session-hangup, in my case for R version 3.5:
cd ~/.rstudio/sessions/active/session-45204d30
rm -rf suspended-session-data

How to run multiple debug instances of a GM:S game

I'm building a client/server application in Game Maker: Studio 1.4 and need to run two instances of the game for testing. Unfortunately, the IDE's run/debug buttons disable themselves after starting the first copy. Is there a way to configure the IDE to permit two instances to run concurrently?
Opening two complete copies of the IDE sort of works, but seems like a great way to break my game by saving things out of sync.
I'm currently exporting the game every time I make a tiny code change and only debugging on the host instance, which is less than ideal.
Is there a way to configure the IDE to allow multiple instances of the game to run via the run/debug buttons?
Allright, here's what I have;
When you compile a game from the IDE you'll see a line like this one somewhere in the compile log:
C:\Users\You\AppData\Roaming\GameMaker-Studio\Runner.exe -game "C:\Users\You\AppData\Local\gm_ttt_92729\gm_ttt_68071\GAME.win"
When you execute that script in a command line (START+R) you'll see the game runs just fine.
In order to automate this, I am using the working_directory variable (which returns C:\Users\You\AppData\Local\gm_ttt_92729\gm_ttt_68071.
As GM:S does not support executing shell scripts, I have added this free asset to my game:
https://marketplace.yoyogames.com/assets/575/execute-shell
In my game I have added a button which calls this code;
ExecuteShell('%appdata%\Roaming\GameMaker-Studio\Runner.exe -game ' + working_directory + "ShootMUp.win",0)
Please note that you'll have to manually edit the .win file name.
But, this works and lets me run multiple instances of the same game without exporting it to .exe or build it again.

Restart R session in Rstudio but continue running script

I'm currently running some queries to a database and getting back some big files as a result. I have encountered the common problem of Windows not freeing the memory, even though I 'rm()' everything and (edit) calling 'gc()'. One workaround i have found is using .rs.restartR() in Rstudio.
This though requires me to constantly watch my script, in order to continue it after the session restart. Is it possible to automate it? If not what other methods do people use to overcome this problem?
You could break the code into 2 files and write a batch file (.bat) that runs the first file through .rs.restartR() and then the remainder of the code in the next file.
You could also skip the .bat and just schedule both .R scripts to run in Task Scheduler.
Also, please see my comment regarding garbage collection (gc()).

Where can I deploy R script and schedule to run it in a timely manner?

I have a small R script. Typically, 15-20 lines of code. This script replies to random people on Twitter. Everything is working fine when I run the code. Now, I want to auto-run this after fixed intervals of time. So, I made a .bat the file of the R script and schedule the task in the windows scheduler to run after every 15 mins. This works fine as well and the way I expect it to work. Now, the problem is the scheduler works only when my system is working. Once I shut down my system, the scheduler also stops working and the script does not execute.
I want a server (not sure if this is the right word), where I can host the R file or .bat file and where I can schedule the script to execute after every X mins. I need a server (??) because I want this to be active 24 X 7.
I have tried deploying it on shinyapps.io but somehow it doesn't work. Have gone through this as well, with no help. Any help would be appreciated.

Resources