Bug 316829 - slow c++ code import
Summary: slow c++ code import
Status: RESOLVED FIXED
Alias: None
Product: umbrello
Classification: Applications
Component: general (show other bugs)
Version: SVN
Platform: Other All
: NOR normal
Target Milestone: ---
Assignee: Umbrello Development Group
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-03-16 09:44 UTC by Ralf Habacker
Modified: 2013-03-27 07:58 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In: 4.10.2
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ralf Habacker 2013-03-16 09:44:16 UTC
Importing a huge number of classes required too much time (80 classes from umbrello source code needs about 3 minutes on a recent dual core laptop on linux) 


Reproducible: Always

Steps to Reproduce:
1.start umbrello 
2. open import wizard
3. import umbrello source code
Actual Results:  
umbrello needs very long time to finish the import

Expected Results:  
umbrello should be import the classes faster
Comment 1 Ralf Habacker 2013-03-16 09:58:06 UTC
There are two reasons why the import is so slow. 

1. The c+ class importer parses by default all includes file for a given file. The advantage is that umbrello is able to find most definitions and do not need to ask the user to identify unknown namespaces or classes. The drawback is that the parser needs much time to parse. 
A solution is here to add an option, which disables the dependency resolution and let umbrello ask for non defined namespaces or classes. 

2. The Tree View object needs much update time when adding entries. Hiding the related dockwindow the list view while importing will speed up the import. 

Another approach would be to include the c++ parser from recent kdevelop project. 
Unfortunally this has been rejected https://bugs.kde.org/show_bug.cgi?id=297321
Comment 2 Ralf Habacker 2013-03-16 14:27:56 UTC
Git commit 52fb1a74cf88216f6b9df8a8bfc6c84d6e9c3eaa by Ralf Habacker.
Committed on 15/03/2013 at 18:28.
Pushed by habacker into branch 'master'.

Add 'resolve dependencies' option to c++ code import settings.

If this attribute is set to false included files are not parsed, which
speeds up importing.

M  +2    -2    umbrello/codeimport/cppimport.cpp
M  +3    -0    umbrello/dialogs/codeimportoptionspage.cpp
M  +15   -2    umbrello/dialogs/codeimportoptionspage.ui
M  +1    -0    umbrello/optionstate.h
M  +5    -0    umbrello/umbrello.kcfg
M  +2    -0    umbrello/uml.cpp

http://commits.kde.org/umbrello/52fb1a74cf88216f6b9df8a8bfc6c84d6e9c3eaa
Comment 3 Ralf Habacker 2013-03-16 14:32:04 UTC
Git commit deed8d83b1303daaa7ca11a990a56560d1a091fb by Ralf Habacker.
Committed on 16/03/2013 at 15:19.
Pushed by habacker into branch 'master'.

Speed up c++ code import by hiding the list view dock window.

M  +7    -0    umbrello/codeimpwizard/codeimpstatuspage.cpp
M  +1    -0    umbrello/codeimpwizard/codeimpstatuspage.h

http://commits.kde.org/umbrello/deed8d83b1303daaa7ca11a990a56560d1a091fb
Comment 4 Ralf Habacker 2013-03-27 07:58:56 UTC
Git commit 66228d2fdc7b86d41b68b7c0c4b95ada4a27a569 by Ralf Habacker.
Committed on 15/03/2013 at 18:28.
Pushed by habacker into branch 'KDE/4.10'.

Add 'resolve dependencies' option to c++ code import settings.

If this attribute is set to false included files are not parsed, which
speeds up importing.

M  +2    -2    umbrello/codeimport/cppimport.cpp
M  +3    -0    umbrello/dialogs/codeimportoptionspage.cpp
M  +15   -2    umbrello/dialogs/codeimportoptionspage.ui
M  +1    -0    umbrello/optionstate.h
M  +5    -0    umbrello/umbrello.kcfg
M  +2    -0    umbrello/uml.cpp

http://commits.kde.org/umbrello/66228d2fdc7b86d41b68b7c0c4b95ada4a27a569