Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » [XTEND] best practices cached extensions
[XTEND] best practices cached extensions [message #504077] Thu, 17 December 2009 06:36 Go to next message
ekkehard gentz is currently offline ekkehard gentzFriend
Messages: 118
Registered: July 2009
Location: rosenheim, Germany, bavar...
Senior Member

This is a multi-part message in MIME format.
--------------040902090601000704070006
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit

I'm using some constants in this way:

String SIMPLE_SEARCH_PREFIX() : "SIMPLESEARCH#";

I'm always caching complex extensions called often,
but does it make sense to cache such a simple thing like getting a String ?

cached String SIMPLE_SEARCH_PREFIX() : "SIMPLESEARCH#";

would be called some hundred times from one workflow - run

--

ekke (ekkehard gentz)
independent software-architect
senior erp-consultant
eclipse | osgi | equinox | mdsd | oaw | emf | uml
max-josefs-platz 30, D-83022 rosenheim, germany
mailto:ekke@ekkes-corner.org
homepage (de): http://gentz-software.de
blog (en): http://ekkes-corner.org
twitter: @ekkescorner
skype: ekkes-corner
Steuer-Nr: 156/220/30931 FA Rosenheim, UST-ID: DE189929490


--------------040902090601000704070006
Content-Type: text/html; charset=ISO-8859-15
Content-Transfer-Encoding: 7bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
</head>
<body bgcolor="#ffffff" text="#000000">
I'm using some constants in this way:<br>
<br>
String SIMPLE_SEARCH_PREFIX() : "SIMPLESEARCH#";<br>
<br>
I'm always caching complex extensions called often,<br>
but does it make sense to cache such a simple thing like getting a
String ? <br>
<br>
cached String SIMPLE_SEARCH_PREFIX() : "SIMPLESEARCH#";<br>
<br>
would be called some hundred times from one workflow - run<br>
<br>
<div class="moz-signature">-- <br>
<p style="margin-bottom: 0cm;"> <font ,="" color="#808080"
face="Verdana, sans-serif"> <font size="4">ekke (ekkehard gentz)<br>
</font> <font size="3"> independent software-architect<br>
senior erp-consultant<br>
</font> <font size="2">eclipse | osgi | equinox | mdsd | oaw | emf |
uml<br>
max-josefs-platz 30, D-83022 rosenheim, germany<br>
<a class="moz-txt-link-freetext" href="mailto:ekke@ekkes-corner.org">mailto:ekke@ekkes-corner.org</a><br>
homepage (de): <a class="moz-txt-link-freetext" href="http://gentz-software.de">http://gentz-software.de</a><br>
blog (en): <a class="moz-txt-link-freetext" href="http://ekkes-corner.org">http://ekkes-corner.org</a><br>
twitter: @ekkescorner<br>
skype: ekkes-corner<br>
</font> <font size="1"> Steuer-Nr: 156/220/30931 FA Rosenheim, UST-ID:
DE189929490<br>
</font> </font> </p>
</div>
</body>
</html>

--------------040902090601000704070006--


ekke
independent software architect

blog: http://ekkes-corner.org
twitter: @ekkescorner
Re: [XTEND] best practices cached extensions [message #504165 is a reply to message #504077] Thu, 17 December 2009 14:13 Go to previous message
Sven Efftinge is currently offline Sven EfftingeFriend
Messages: 1771
Registered: July 2009
Senior Member
No it doesn't make sense, since string literals are not computed.
They will always return the same instance.

Cheers,
Sven

ekke schrieb:
> I'm using some constants in this way:
>
> String SIMPLE_SEARCH_PREFIX() : "SIMPLESEARCH#";
>
> I'm always caching complex extensions called often,
> but does it make sense to cache such a simple thing like getting a String ?
>
> cached String SIMPLE_SEARCH_PREFIX() : "SIMPLESEARCH#";
>
> would be called some hundred times from one workflow - run
>
> --
>
> ekke (ekkehard gentz)
> independent software-architect
> senior erp-consultant
> eclipse | osgi | equinox | mdsd | oaw | emf | uml
> max-josefs-platz 30, D-83022 rosenheim, germany
> mailto:ekke@ekkes-corner.org
> homepage (de): http://gentz-software.de
> blog (en): http://ekkes-corner.org
> twitter: @ekkescorner
> skype: ekkes-corner
> Steuer-Nr: 156/220/30931 FA Rosenheim, UST-ID: DE189929490
>


--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
Twitter : @svenefftinge
Blog : blog.efftinge.de


--
Need professional support on Xtext or Xtend?
Mail to: xtext (at) itemis.com
Twitter : @svenefftinge
Blog : blog.efftinge.de
Re: [XTEND] best practices cached extensions [message #504223 is a reply to message #504165] Thu, 17 December 2009 13:18 Go to previous message
ekkehard gentz is currently offline ekkehard gentzFriend
Messages: 118
Registered: July 2009
Location: rosenheim, Germany, bavar...
Senior Member

This is a multi-part message in MIME format.
--------------010206040004050900060305
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit

thx - thats what I expected ;-)

ekke

Sven Efftinge schrieb:
> No it doesn't make sense, since string literals are not computed.
> They will always return the same instance.
>
> Cheers,
> Sven
>
> ekke schrieb:
>> I'm using some constants in this way:
>>
>> String SIMPLE_SEARCH_PREFIX() : "SIMPLESEARCH#";
>>
>> I'm always caching complex extensions called often,
>> but does it make sense to cache such a simple thing like getting a
>> String ?
>>
>> cached String SIMPLE_SEARCH_PREFIX() : "SIMPLESEARCH#";
>>
>> would be called some hundred times from one workflow - run
>>
>> --
>>
>> ekke (ekkehard gentz)
>> independent software-architect
>> senior erp-consultant
>> eclipse | osgi | equinox | mdsd | oaw | emf | uml
>> max-josefs-platz 30, D-83022 rosenheim, germany
>> mailto:ekke@ekkes-corner.org
>> homepage (de): http://gentz-software.de
>> blog (en): http://ekkes-corner.org
>> twitter: @ekkescorner
>> skype: ekkes-corner
>> Steuer-Nr: 156/220/30931 FA Rosenheim, UST-ID: DE189929490
>>
>
>


--

ekke (ekkehard gentz)
independent software-architect
senior erp-consultant
eclipse | osgi | equinox | mdsd | oaw | emf | uml
max-josefs-platz 30, D-83022 rosenheim, germany
mailto:ekke@ekkes-corner.org
homepage (de): http://gentz-software.de
blog (en): http://ekkes-corner.org
twitter: @ekkescorner
skype: ekkes-corner
Steuer-Nr: 156/220/30931 FA Rosenheim, UST-ID: DE189929490


--------------010206040004050900060305
Content-Type: text/html; charset=ISO-8859-15
Content-Transfer-Encoding: 8bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-15"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
thx - thats what I expected ;-)<br>
<br>
ekke<br>
<br>
Sven Efftinge schrieb:
<blockquote cite="mid:hgdea3$teq$2@build.eclipse.org" type="cite">No it
doesn't make sense, since string literals are not computed.
<br>
They will always return the same instance.
<br>
<br>
Cheers,
<br>
Sven
<br>
<br>
ekke schrieb:
<br>
<blockquote type="cite">I'm using some constants in this way:
<br>
<br>
String SIMPLE_SEARCH_PREFIX() : "SIMPLESEARCH#";
<br>
<br>
I'm always caching complex extensions called often,
<br>
but does it make sense to cache such a simple thing like getting a
String ?
<br>
<br>
cached String SIMPLE_SEARCH_PREFIX() : "SIMPLESEARCH#";
<br>
<br>
would be called some hundred times from one workflow - run
<br>
<br>
--


ekke
independent software architect

blog: http://ekkes-corner.org
twitter: @ekkescorner
Previous Topic:The Generator does not produce the correct results from the first time!?
Next Topic:[XPAND] perform OAW code without creating physical files
Goto Forum:
  


Current Time: Thu Nov 27 02:00:42 GMT 2014

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

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