[JET] Enhancement: public void generate(PrintStream stream, Object argument) [message #431717] |
Wed, 22 July 2009 14:43  |
Eclipse User |
|
|
|
Hello,
First of all I must say: EMF rocks. I'm writing a compiler and trying
out EMF by using it to model my AST objects. First I was sceptic, but
now I'm excited, because EMF saves me a lot of work.
For the code generation part I use JET. In my scenario, a template can
call other templates recursively. The current interface of a JET
template is:
public String generate(Object argument)
With this interface I have a massive perfomance (and memory) problem,
since every call of a template creates a String. I have extended JET so
that a template can optionally be generated with another interface.
public void generate(PrintStream stream, Object argument)
With this new interface the templates are directly written into one
single stream without generating lots of temporary Strings. Now my
compiler takes just seconds instead of more than 20 minutes to generate
about 10 MB code. I would like to contribute my changes:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=284010
Any comments?
With very best regards
Gregor
|
|
|
Re: [JET] Enhancement: public void generate(PrintStream stream, Object argument) [message #431747 is a reply to message #431717] |
Thu, 23 July 2009 12:02   |
Eclipse User |
|
|
|
Gregor,
It would be better to enhance JET2, but if the changes are simple, I'd
certainly be willing to incorporate them in the older JET1 base.
Gregor Pfeifer wrote:
> Hello,
> First of all I must say: EMF rocks. I'm writing a compiler and trying
> out EMF by using it to model my AST objects. First I was sceptic, but
> now I'm excited, because EMF saves me a lot of work.
>
> For the code generation part I use JET. In my scenario, a template can
> call other templates recursively. The current interface of a JET
> template is:
>
> public String generate(Object argument)
>
> With this interface I have a massive perfomance (and memory) problem,
> since every call of a template creates a String. I have extended JET
> so that a template can optionally be generated with another interface.
>
> public void generate(PrintStream stream, Object argument)
>
> With this new interface the templates are directly written into one
> single stream without generating lots of temporary Strings. Now my
> compiler takes just seconds instead of more than 20 minutes to
> generate about 10 MB code. I would like to contribute my changes:
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=284010
>
> Any comments?
>
> With very best regards
> Gregor
|
|
|
|
Powered by
FUDForum. Page generated in 0.04509 seconds