Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » LazyFragmentInitializer in URI
LazyFragmentInitializer in URI [message #1783558] Wed, 14 March 2018 07:01 Go to next message
mind calm is currently offline mind calmFriend
Messages: 57
Registered: July 2017
Member
Hi,

I'm testing the performance of Sirius, i found the function enqueue() in the constructor of LazyFragmentInitializer is a litter time-consuming.
I'm confused with it, I don't know the purpose of queue. Can i commented out the call of enqueue()?


Best regards!

by Keep Mind Calm
Re: LazyFragmentInitializer in URI (*edited) [message #1783575 is a reply to message #1783558] Wed, 14 March 2018 09:42 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33137
Registered: July 2009
Senior Member
Likely you're measuring using YourKit and you are using Sampling rather than Tracing, right? Past experience indicates that Sampling gives wildly misleading measurements for the cost of this method. Consider this code, for example:
package uri.test;

import org.eclipse.emf.common.util.URI;

public class Test
{

  public static void main(String[] args) throws Exception
  {
    System.in.read();
    measure();
  }

  public static void measure()
  {
    long start = System.currentTimeMillis();
    for (int i = 0; i < 1000000; ++i)
    {
      URI.createURI("http://host " + i + "#" + i + '/' + i);
    }
    long end = System.currentTimeMillis();
    System.out.println("elapsed=" + (end - start));
  }
}
Measuring with sampling produces this result:
index.php/fa/32323/0/
But measuring using tracing produces this result:
index.php/fa/32324/0/


Ed Merks
Professional Support: https://www.macromodeling.com/

[Updated on: Wed, 14 March 2018 09:43]

Report message to a moderator

Re: LazyFragmentInitializer in URI (*edited) [message #1783577 is a reply to message #1783575] Wed, 14 March 2018 09:54 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33137
Registered: July 2009
Senior Member
Also note that actual in-line measurement (using System.currentTime) with the LazyFragmentInitializer disabled confirms that this enqueue method definitely does not incur 72% overhead as sampling measurements would indicate, so it is definitely not worth your attention in your effort to optimize your application.

Ed Merks
Professional Support: https://www.macromodeling.com/
Re: LazyFragmentInitializer in URI (*edited) [message #1783670 is a reply to message #1783575] Thu, 15 March 2018 11:56 Go to previous message
mind calm is currently offline mind calmFriend
Messages: 57
Registered: July 2017
Member
Hi, Ed Merks

Thanks for your reply and detailed tests analysis, I got it.


Best regards!

by Keep Mind Calm
Previous Topic:ArrayIndexOutOfBoundsException when calling BasicEList.toArray
Next Topic:CDO/net4j communication
Goto Forum:
  


Current Time: Fri Apr 19 20:58:26 GMT 2024

Powered by FUDForum. Page generated in 0.03149 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top