Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 349675 - [EMF Runtime Extensions] Performance improvements of MetaModelDescriptorRegistry
Summary: [EMF Runtime Extensions] Performance improvements of MetaModelDescriptorRegistry
Status: CLOSED FIXED
Alias: None
Product: Sphinx
Classification: Automotive
Component: Core (show other bugs)
Version: 0.7.0   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Robert Kiss CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-17 07:59 EDT by Robert Kiss CLA
Modified: 2021-07-14 02:16 EDT (History)
0 users

See Also:


Attachments
mylyn/context/zip (1.60 KB, application/octet-stream)
2011-08-01 07:10 EDT, Robert Kiss CLA
idydieng: iplog+
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Robert Kiss CLA 2011-06-17 07:59:30 EDT
Build Identifier: 

There are several performance improvements that can be performed quite easily on the MetaModelDescriptorRegistry:

1. getDescriptor(EPackage) and getDescriptor(URI) shall use a precompiled pattern for regexp.

2. Use LinkedHashMap instead of HashMap to keep the descriptor. In case of multiple descriptor the same performance will be obtained at each run.

3. Even if multiple descriptors are defined during a heavy computing user action only one or two descriptors are actually used. If those descriptors are the last in the hash a lot of cpu cycles are wasted. The proposal would be:
- each time getDescriptor(T mmDescriptor, IDescriptorFilter filter) is used and the returned descriptor is not the first in the list change the list by moving the found descriptor to the first position. This way the next call of the method, which probably will look for the same descriptor, will execute faster.

Reproducible: Always
Comment 1 Stephan Eberle CLA 2011-07-08 19:42:41 EDT
(In reply to comment #0)
Good ideas! I'm ok with all of them, they can be implemented right away.

@1. Note precompiled patterns must be used in this - rather non intuitive - way to be effective: 

  return Pattern.compile(descriptor.getEPackageNsURIPattern()).matcher(nsURI).matches()
Comment 2 Robert Kiss CLA 2011-07-12 07:37:42 EDT
I might have time to work on this in the July/August.
Comment 3 Robert Kiss CLA 2011-08-01 07:10:49 EDT
Resolved
Comment 4 Robert Kiss CLA 2011-08-01 07:10:51 EDT
Created attachment 200650 [details]
mylyn/context/zip
Comment 5 Balazs Grill CLA 2021-07-14 02:16:51 EDT
Mass-closing Resolved tickets