[umbrello] [Bug 449465] Pascal code import is very slow

2022-06-12 Thread Oliver Kellogg
https://bugs.kde.org/show_bug.cgi?id=449465

Oliver Kellogg  changed:

   What|Removed |Added

   Version Fixed In||2.34.70 (KDE releases
   ||22.07.70)
 Status|CONFIRMED   |RESOLVED
 Resolution|--- |FIXED
  Latest Commit||https://invent.kde.org/sdk/
   ||umbrello/commit/0d855d0deb4
   ||19f0a38bc486ce0441da4298890
   ||4b

--- Comment #4 from Oliver Kellogg  ---
Git commit 0d855d0deb419f0a38bc486ce0441da42988904b by Oliver Kellogg.
Committed on 13/06/2022 at 05:56.
Pushed by okellogg into branch 'master'.

Fix "Pascal code import is very slow"

umbrello/umllistviewitem.{h,cpp}
- Remove empty reimplementation of destructor (we want the parent
  destructor to execute).
- Member m_comap is renamed to s_comap, changed to `static`, and is
  changed pointer. It now acts as a global map for all UMLObjects
  pertaining to the list view. The switch to pointer is done for
  reducing risk of static initialization order problems.
- New static function deleteItem removes the given UMLListViewItem from
  s_comap and calls its destructor.
- At function findChildObject add `const` on argument `child`.
- New protected function findUMLObject_r is auxiliary to findUMLObject.
  It is invoked when the given object is not found in s_comap.
- Change implementation of ChildObjectMap from QMap to QHash.
  Reason: QHash is more appropriate for pointer arguments.

umbrello/umllistviewitem.cpp
- In function init() allocate s_comap if null.
- Adjust functions addChildItem, deleteChildItem, deepCopy to the
  changes related to m_comap -> s_comap.

umbrello/umllistview.cpp
- In function slotObjectCreated add calls to parentItem->addChildItem()
  for updating s_comap.
- In function slotObjectRemoved replace destruction of `item` by call to
  deleteItem() in order to update s_comap.
- In function init(),
  - reduce content of `if (m_rv == 0)`;
  - call clean() unconditionally;
  - execute for-loop over N_MODELTYPES unconditionally and in its body
add call to m_rv->addChildItem(sysFolder, m_lv[i]) for updating
s_comap;
  - call m_lv[Uml::ModelType::Logical]->addChildItem(datatypeFolder) for
updating s_comap with m_datatypeFolder.
- In function clean(),
  - clean up documentation;
  - set m_datatypeFolder to 0;
  - in for-loop over N_MODELTYPES remove call to deleteChildrenOf() and
add setting of m_lv[i] to 0;
  - call deleteChildrenOf(m_rv).
- In function moveObject,
  - remove handling of m_doc->loading() (see function acceptDrag);
  - replace `delete move` by UMLListViewItem::deleteItem(move) for
updating s_comap;
  - add handling of case UMLListViewItem::lvt_EnumLiteral.
- In function addNewItem case instanceOfClass add call to
  instanceItem->addChildItem() for updating s_comap.
- In function loadChildrenFromXMI loading of structural objects add
  call to parent->addChildItem() to update s_comap.
- In function deleteChildrenOf case (typeIsCanvasWidget(lvt) ||
  typeIsClassifierList(lvt)) case !object, replace `delete temp` by call
  to UMLListViewItem::deleteItem(temp).
FIXED-IN: 2.34.70 (KDE releases 22.07.70)

M  +86   -65   umbrello/umllistview.cpp
M  +58   -18   umbrello/umllistviewitem.cpp
M  +8-6umbrello/umllistviewitem.h

https://invent.kde.org/sdk/umbrello/commit/0d855d0deb419f0a38bc486ce0441da42988904b

-- 
You are receiving this mail because:
You are watching all bug changes.

[umbrello] [Bug 449465] Pascal code import is very slow

2022-02-18 Thread Jessica
https://bugs.kde.org/show_bug.cgi?id=449465

--- Comment #3 from Jessica  ---
SUCK MY MOTHERFUCKING CLIT

-- 
You are receiving this mail because:
You are watching all bug changes.

[umbrello] [Bug 449465] Pascal code import is very slow

2022-02-04 Thread Jessica
https://bugs.kde.org/show_bug.cgi?id=449465

--- Comment #2 from Jessica  ---
Ok. The crash is fixed and it's working now!

-- 
You are receiving this mail because:
You are watching all bug changes.

[umbrello] [Bug 449465] Pascal code import is very slow

2022-02-02 Thread Oliver Kellogg
https://bugs.kde.org/show_bug.cgi?id=449465

Oliver Kellogg  changed:

   What|Removed |Added

 Status|REPORTED|CONFIRMED
 CC||okellogg@users.sourceforge.
   ||net
 Ever confirmed|0   |1

--- Comment #1 from Oliver Kellogg  ---
el888-source has 241473 total lines of code with a few hefty files,
   3496 ShellCtrls.pas
   3683 Menus.pas
   4740 uCommon.pas
   5145 StdCtrls.pas
   5262 ExtCtrls.pas
   7318 arcade/uMAMESettings.pas
   9057 CommCtrl.pas
  11003 Controls.pas
  18035 system.pas
  22955 ComCtrls.pas
  31087 Windows.pas
  51592 uMain.pas

On importing all, that works out to around 400 lines per second.
I'd say the speed is in a gray area but could use improving.
Don't forget that prior to the fixes, it was importing only a fraction of the
classes/attributes due to bugs - that's why it was faster then.

-- 
You are receiving this mail because:
You are watching all bug changes.