Eclipse NEON Running Locally - Testing javaScript - Replace File While Running - javascript

Testing is really slow going for me in Eclipse. Deploy -> log into my site -> navigate to the appropriate screen, etc. While running locally, I am connecting to an external Dev database which doesn't have much horsepower. Total turn-around can be from 5-15 minutes depending on the day. Find out a quote is in the wrong place, rinse and repeat...
My question is this - Is there a way to replace a page on the fly while running locally? This way I can fix the error, replace the single page, hit refresh in the browser and continue with the updated page? If so, where is the file being stored on the hard drive when Apache is running?
Sorry if this is a silly question, back in the old days I could do this all the time. Just getting frustrated over here because I spend 5% of my time writing code and 95% going back and forth testing it because of the slow turn around.

Related

NodeJS express page takes too long to load

I have been working on a project for a while now using NodeJS and express to make a website. It is hosted on heroku right now.
When I was testing it during developement, I did not have any issues with load time. However when I tested it in a different Wifi than usual (which did not differ much in download speed from the usual) some pages suddenly take 40-60 seconds to load as seen below.
What I don't understand is the big gap where nothing(?) happens.
I am still studying atm so I am still very inexperienced. Any help is greatly appreciated.
I would also be thankful for any links to best practices on how to go about this as I couldn't really find anything that helped me.
And please let me know if there is any more information needed to diagnose this, thank you.
It's not "nothing" happening during the big gap. You just missed what is happening. Look at the top of the graph. You will see the long green bar that's downloading. That's what's happening. It is downloading the main html file (I think the url is /).
It takes 38 seconds (38233 milliseconds) to load the html the first time and 52 seconds (52444 milliseconds) the second time. This is because your html file is 7.5MB - which is around two mp3 files.
The download times are what I would expect from trying to download two mp3 files - around 1 minute.
Find out why your HTML is 7.5MB. That's what is slowing the page load.
Instead of worrying about the “nothing gab”, start by worrying about them images you have: 300k+, 280k+.. and the rest all them pics make your html file to weight 7,45M. So the nothing huge gan is because yow browser is downloading all them pics, plus up on that consider yow free plan at heroku. Them bros are not going to give you their best suite for free

Wildfly: Code changes aren't reflected in browser after deployment

I am new to Wildfly, and deployment in general, so I apologize if this is a weird question. For a while now, I've been using Wildfly to deploy my application and haven't had any issues. However, recently, I started noticing that after a certain amount of time, changes made in my js files aren't reflected in the browser. I open the files up in the Chrome debugger tool and they aren't updated.
I read online that to solve this, I should shut down Wildfly and delete the tmp folder and then restart the server. When I did this in the beginning, files were being updated, but then I noticed it happened again, so I repeated the same steps. Every time, it seemed that issue would show up sooner and sooner, to the point where I can only deploy a few times before the issue comes back.
If someone can please give me any pointers, I'd really appreciate it. If I'm missing vital info in the question, please let me know so I can provide it. Thanks.
(I'm using Wildfly 24.0.0 Final in case that's important)

Why would a node.js profile be multiple GB in size? way to big for webstorm to handle

So, I'm trying to profile an existing large-ish node.js webapp.
It seems to run OK, when running normally, I added a debug launch configuration.
My first attempt, I left it running, attempting to load a very complex page - came back to find a 4GB profile log had filled the remaining space on the small partition it (and my system) is on causing all sorts of problems.
Did a quick test, running the server for only a few seconds, got a ~15MB profile of it loading some modules - but it works.
A second attempt - watching much closer, I started loading a simpler page as soon as the server was accepting connections (watching the profile log grow at ~3mb/s) - by the time the page had loaded, I have a 600MB log, stop the server to see the results.
After waiting for quite a long time, phpstorm complains it does not have enough memory - limited to 750MB.
I've increased it to 1500MB - but thought I should ask for some wisdom here before another test, as this profiler really does not seem practical!
Am I just expecting too much for this profiler to give me info on a complex app(and I should use a different profiler)?
Does this indicate some kind of problem with the app?
Perhaps I am doing something wrong?
All answers welcome!
Edit: the command phpstorm runs is /usr/bin/node --prof --logfile=v8-23-11-15_00-37-35-0.log --log-timer-events bin/www
OK, removing --log-timer-events makes the log a reasonable size, and the server runs at a decent speed! There is less info - but it still seems to contain much of what I am hoping/expecting to see.
Not marking this answer as accepted, as I feel I am still floundering in the dark a little more than I'd like.

Long-polling Slowing Down Web App

This is more of a concept question as I am trying to learn more about long-polling, in Javascript/jQuery specifically. I have a web app where I am long-polling (websockets are not an option right now) to a json file. I have run some tests and after leaving the app open for some time, it starts to slow down and later seems to start getting stuck. Using Chrome, I've checked the developer tools and the memory starts going through the roof, as with the listeners (>5000) around 1 1/2 hours of up time. I've searched and searched but can't find forums that pinpoint this problem and solution. In my code, I am using setInterval every 30 seconds. What do I need to do in order to keep the memory and listeners count low, and make sure the app does not overload and get slow? The function of the app requires it to stay up for long periods of time.
Thank you for your help.

MVC Project often recompiles after JS changes, don't know why, results in problems

I have a medium-sized ASP.NET MVC project with a lot of Javascript (Single-Page-App). Very often (dozens of times a day), when I edit the Javascript files and refresh it, I see in VS' output that it goes through the whole Application_Start process (as in (re-)starting the app).
This results in unwanted delays during development and after 2-4 such restarts, I get an InvalidOperationException "Not running in a hosted service or the Development Fabric.". Since I do run it in the emulator, it seems to be that after a few app-restarts, it loses its connection to the emulator. Apart from that, I even got (although very rare) OutOfMemoryExceptions, which I can't find out where they are coming from, because nothing in the web app should allocate much memory and my workstation does have quite a lot (32 GiB).
It can't be related to an idle timeout for the IIS (Express) worker process, since the JS changes often only took seconds. I tried to reproduce it by adding spaces to the JS file and saving it, repeating that a few times and then trying to refresh. Weirdly, I was unable to reproduce it this way.
I am out of ideas, help would really be appreciated :)
[Edit]
Not an answer yet, but a possibility. It seems like Web Essentials is compiling my LESS files each time I save them (even after I specifically deactivated that because ASP.NET Bundling and Minification already handles that), which result in quite a few additional writes because I have the habit of saving VERY often. Already contacted the developer, maybe it's a bug.
This is actually due to IIS behaviour. IIS recycles any app if there is any change in the files in its file structure.
I had a similar experience and detailed my understanding here: http://www.geekays.net/post/2008/10/14/ASPNET-webdomain-recycle-on-subfolder-changes.aspx

Categories