thehogfather / brackets-code-folding

Code folding extension for brackets IDE
134 stars 42 forks source link

very very very slow in Linux #81

Closed mbpcoder closed 9 years ago

mbpcoder commented 10 years ago

hi this extension is a necessary tools in Brackets i am using your extension on Ubuntu when i install this extension, my Brackets became very very very slow. when i want to open a long file it takes around 10 seconds and if i remove it every thing became fast again thanks for great work

thehogfather commented 10 years ago

Hey I currently don't have access to my ubuntu machine - but I have been working rewriting the extension to improve performance. If you are willing to try it out then you can download it here https://github.com/thehogfather/brackets-code-folding/archive/show_markers.zip. You would have to install it manually though.

The main difference with the new version is that the fold regions only show up when you move the mouse over the fold gutter then you can click anywhere on the gutter to collapse the region.

If you have the Git extension installed there might be some issues interacting with the fold marks.

mbpcoder commented 10 years ago

hi it doesn't make any difference, it is very very slow in Ubuntu the fold regions was good i think. auto show up the fold icon should be with option to enable it or not yep it has issues with git extension as well thanks

thehogfather commented 10 years ago

I have been unable to reproduce your issue unfortunately. Does this only happen when the file you are opening is large? Would it be possible to share the file or a file that can be used to reproduce the issue? This would be really helpful.

I have made some modifications to the extension to include a settings dialog. It is possible that the restoration of the folded regions in the file is taking time (if you have lots of folded regions in a large file). Could you please test out the updated extension using this url https://github.com/thehogfather/brackets-code-folding -- you might need to first uninstall a previous version. It introduces a "Code folding settings" menu item under the view menu. Uncheck "save fold states" in the dialog and save the settings and let me know if you have any improvements in performance.

mbpcoder commented 10 years ago

I tested the extension. it still works very very slow I tested on different files with different sizes I use Alt + 1 to fold all part of code and it freeze the IDE and i have to kill the IDE 's process. I checked the settings for not saving the region, but the result was the same. also I disabled all my extensions to see maybe it has conflict with another extension but no luck, it was slow like before I tested this extension with the same files in windows 8.1 and windows 7 and it worked very well also I am using different Ubuntu with different hardware in my workplace and home, it is very slow in both of them thanks

thehogfather commented 10 years ago

unfortunately I am unable to help. I cannot reproduce this issue on my basic ubuntu virtual machine with 1gb of ram and very minimal specs. If in the future you are in a position to share a file that I can use to test the issue and any exact steps to reproduce the issue then maybe I will be able to help. For now, it appears there is nothing I can do.

FYI Alt+1 is a very expensive action and will take time to compute on complex files. It basically folds every region in the code that is foldable.

mbpcoder commented 10 years ago

hi i tested this extension on new Brackes (sprint 43) , it was the same unfolding this code takes 3 seconds long that is too much.

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
</head>
<body>

</body>
</html>

i think it is good to have some shortcut for adding, folding and unfolding regions thanks

mbpcoder commented 10 years ago

hi the issue is still there even in last update. i can help for this issue, just tell me where to look for start.

thehogfather commented 10 years ago
  1. Open brackets and make sure the only extension installed is the code-folding extension
  2. Select Debug > Show Developer Tools in the menu
  3. Select the Profiles Tab in the Chrome developer Tools window that opens
  4. Make sure that the "Collect Javascript CPU Profile" radio button is selected and click the "Start" button

The above process will start a profiling session for Brackets. Now go back to the brackets window and fold and unfold the simplest case document in your comment above (i.e., the empty html document). Once you have done that, go back to the Chrome developer tools tab and click stop to stop the profiling.

Right click on the profile and save. And send me the contents of the profile or post it here.

tomByrer commented 10 years ago

I've tried Brackets out on several Linux installs,. & found that Brackets runs in general slow compared to other editors written in other languages. Same issue in Win7_64, where I currently use Brackets.

thehogfather has the right idea to narrow testing to only this, at least for testing. Brackets is not optimized to run many things at once, though Node is.

mbpcoder commented 9 years ago

hi i collect profile information for the extention. give me you your email to send you the profile file (https://cloud.githubusercontent.com/assets/3877538/4555520/9c784152-4ebe-11e4-81bb-23e26ee545ae.png)

thehogfather commented 9 years ago

Email to me at bcfissue81@dustygem.co.uk

thehogfather commented 9 years ago

thanks for sending the profile - will have a look to see what might cause the issue.

wad2eq commented 9 years ago

For me it slowing down bracket to, im using ubuntu.

mbpcoder commented 9 years ago

hi after update the folding became faster but still slower than in windows thanks

ghominejad commented 9 years ago

brackets 0.44 has performance issues with split control that make it very slow. try beta version. they fixed most of performance issues. https://groups.google.com/forum/?fromgroups#!topic/brackets-dev/B4tovzuQPfY

after updating to beta version (0.45) i don't have ide performance problems anymore!

rafaelcastrocouto commented 9 years ago

very slow working on a 3k lines file on my windows 7 with brackets 1 ... btw... loved the extension... gj

FLasH3r commented 9 years ago

Win 8.1 - 16GB Ram, using latest version of Brackets. ANY file above 1000 lines of code - poor performance. slows down the entire IDE.

For now I've removed the plugin - not ideal but I don't wan't a slow IDE.

thehogfather commented 9 years ago

Would it be possible to share (part of) your example file? I would like to reproduce this issue. I dont think it is simply a matter of lines of code since one of my test files include a file with over 115,000 lines of code. I think the overall structure of the files been tested would help pin down the performance issue. Also would you be able to try a few things:

thehogfather commented 9 years ago

It might also be useful to try reproduce the issue using files from brackets source (that way you wont have to share potentially private code). E.g., src/editor/Editor.js is 2464 loc and does not produce the issue on my Windows machine. @rafaelcastrocouto @FLasH3r does this file reproduce the issue on your system?

FLasH3r commented 9 years ago

@thehogfather will test it out and let you know, thanks

rafaelcastrocouto commented 9 years ago

The tips from @thehogfather improved a lot the performance in my machine. It's easier to detect the issue when using "Alt + 1" in order to close all folds. Before changing the settings, it used to take about 4 sec to close everything, now it takes ~= 1 sec ... I'm editing this file: https://github.com/rafaelcastrocouto/dotacard/blob/gh-pages/client.js It's open source and can be used to try reproducing the issue.

Thx a lot @thehogfather!

thehogfather commented 9 years ago

Thanks @rafaelcastrocouto - there should now be a fold-level option in the settings. Please test and see how well it works.

rafaelcastrocouto commented 9 years ago

Works like a charm! :+1: It really improved the performance... Thx a lot

cturk commented 8 years ago

I'm finding brackets running slow and even locks up sometimes in Ubuntu. Been using Sublime in the mean time. :(