How to speed up slow javascript?
Hi,
For some reason my javascript file gets very slow when it reaches a size hardly exceeding a couple of pages.
Not just code asist, but even typing code itself lags. It is frustrating enough to spend time on, and so here's why I didn't file it as an issue:
I know you were aware of some speed issues in the eap's so you must be working on it already. I was thinking since I have generally little to no regard about conforming to coding standards and existing architectures could the highly dynamic nature of the language be setting up a bottleneck at some of my more experimental constructs?
Would someone have some ideas as to what kind of javascript code generally could have an effect of slowing down the phpstorm system?
Thanks for your input!
Please sign in to leave a comment.
Hello Leo,
Can you please provide some of your files (it can be done privately by e-mail), or take a performance snapshot according to http://devnet.jetbrains.net/message/5290216#5290216?
Thanks,
Kirill
Edit: I would really like, though, to be more informed about the underlaying concepts of the ide and if it's optimized for certain constructs or if some are too heavy for it. The speed problem page lists only the basic and obvious that has nothing to do with the way code is shaped.
This is an excerpt from a php file I've been working on for a very simple discussion.
It's contained within a script tag at the bottom of a mix of php and html.
It uses jQuery 1.5 and
A javascript file (15 pages or so) that keeps a number of functions I've written - so all the functions that are not part of jquery are contained there.
Generally I would much rather work in my large javascript file, but it is impossibly slow at this point, so I work directly in the php and later copy it over, but even this is slowing down.
My system: Snow Leopard .6.6 Macbook Pro core 2 duo 2.4Ghz 4G ram:
Incomplete code is almost useless, sorry.
Please get latest EAP build (PhpStorm 2.1#444), collect more information about the problem per instructions in http://devnet.jetbrains.com/docs/DOC-192 and attach it to the YouTrack ticket.
Thanks, but I believe my request was a bit more sublime than "fix my slow ide".
I din't see any answers to my question on your site or in help.
An example of an answer could be "phpstorm currently does not handle nested inline variable functions very well" or "phpstorm will parse faster if variables are defined first in an object". This is an approach from the opposite side of the issue where instead of you analyzing my code you would tell me more about your system's parsing philosophy.
Cheers
Well, we need the requested CPU snapshot to give you any advice or fix our IDE.
Thanks for your attention, but I still feel like my question is not being understood.
You see if I give you a snapshot - this will make the request specific to me and my project.
I wanted to know if there was an ide-specific direction or preference. So to speak, the subject of my sentence isn't myself but the ide.
Is the question un-answerable? Is it a trade secret? Or is it simply boring to everyone at Intellij to talk about the underlaying principles of their software?
Kind regards
Well, the general idea is that code should target developer and not the IDE.
IDE should ideally understand any code.
Anyway - the logic behind JS code analysis is way to complex to explain.
Also, I think we are kind of focused on practical side - if there obvious performance problems in IDE that you were able to reproduce we want to fix them. And to check that we need either full source code or at least proper performance snapshot.
I have same issue for WebStorm 8. I am looking for solution/answer here around. But it is interesting to find out that in this forum it seems always advise for uploading CPU snapshot since 2010 or earlier post. Could not find a solution till today, May, 2014.
How long it would take for JetBrain guys to spend (so many years) and still doing analysis and still no clue?
The root cause of the issue can be different from 2010 to 2014. If you experience performance issue, take care to follow: https://intellij-support.jetbrains.com/entries/29983118 and feel free to file a bug report: http://youtrack.jetbrains.com/issues/WI#newissue=yes .