<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>profiler &#8211; Alessandro Crugnola &#8211; sephiroth.it</title>
	<atom:link href="https://blog.sephiroth.it/tag/profiler/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.sephiroth.it</link>
	<description>programmer by pure chance</description>
	<lastBuildDate>Sun, 20 Jun 2010 07:15:31 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	

<image>
	<url>https://blog.sephiroth.it/wp-content/uploads/2019/03/cropped-sepy-big-32x32.png</url>
	<title>profiler &#8211; Alessandro Crugnola &#8211; sephiroth.it</title>
	<link>https://blog.sephiroth.it</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Flex 3 &#8220;Moxie&#8221; sneak peeks</title>
		<link>https://blog.sephiroth.it/2007/06/06/flex-3-moxie-sneak-peeks/</link>
					<comments>https://blog.sephiroth.it/2007/06/06/flex-3-moxie-sneak-peeks/#respond</comments>
		
		<dc:creator><![CDATA[Alessandro Crugnola]]></dc:creator>
		<pubDate>Wed, 06 Jun 2007 18:15:48 +0000</pubDate>
				<category><![CDATA[flex]]></category>
		<category><![CDATA[Flex 3]]></category>
		<category><![CDATA[moxie]]></category>
		<category><![CDATA[profiler]]></category>
		<guid isPermaLink="false">http://blog.sephiroth.it/?p=221</guid>

					<description><![CDATA[<a target="_blank" href="http://www.onflex.org/ted/">Ted Patrick</a> is publishing screenschots of the upcoming new Flex 3 besides with the description of some of the new features..<br /> &#160;With the code refactoring, probably the most interesting new things in Flex 3 are the <a target="_blank" href="http://onflex.org/images/fx3profile1.png">profiler</a> and the <a target="_blank" href="http://onflex.org/images/fx3csd1.png">CSS design</a> view.<p>Check out all the new features on Ted's blog: <br /> <a target="_blank" href="http://www.onflex.org/ted/2007/06/flex-3-tuesday-code-enhancements.php">http://www.onflex.org/.../flex-3-tuesday-code-enhancements.php</a><br /> </p>
]]></description>
										<content:encoded><![CDATA[<p><a href="http://www.onflex.org/ted/" target="_blank"><img decoding="async" title="Flex 3" src="http://www.onflex.org/images/fx_appicon.jpg" border="0" alt="Flex 3" hspace="4" vspace="4" width="50" height="50" align="left" />Ted Patrick</a> is publishing screenschots of the upcoming new Flex 3 besides with the description of some of the new features..<br />
With the code refactoring, probably the most interesting new things in Flex 3 are the <a href="http://onflex.org/images/fx3profile1.png" target="_blank">profiler</a> and the <a href="http://onflex.org/images/fx3csd1.png" target="_blank">CSS design</a> view.</p>
<p>Check out all the new features on Ted&#8217;s blog:<br />
<a href="http://www.onflex.org/ted/2007/06/flex-3-tuesday-code-enhancements.php" target="_blank">http://www.onflex.org/&#8230;/flex-3-tuesday-code-enhancements.php</a></p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.sephiroth.it/2007/06/06/flex-3-moxie-sneak-peeks/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>An experience with antlr, java and python</title>
		<link>https://blog.sephiroth.it/2006/12/01/an-experience-with-antlr-java-and-python/</link>
					<comments>https://blog.sephiroth.it/2006/12/01/an-experience-with-antlr-java-and-python/#comments</comments>
		
		<dc:creator><![CDATA[Alessandro Crugnola]]></dc:creator>
		<pubDate>Fri, 01 Dec 2006 19:09:11 +0000</pubDate>
				<category><![CDATA[general]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[antlr]]></category>
		<category><![CDATA[asdt]]></category>
		<category><![CDATA[bison]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[ecma]]></category>
		<category><![CDATA[gnu flex]]></category>
		<category><![CDATA[grammar]]></category>
		<category><![CDATA[parser]]></category>
		<category><![CDATA[profiler]]></category>
		<category><![CDATA[psyco]]></category>
		<guid isPermaLink="false">http://blog.sephiroth.it/?p=187</guid>

					<description><![CDATA[I just wanted to share a little experience with generating an AS3 parser using antlr and python.I was trying first to create the parser using...
]]></description>
										<content:encoded><![CDATA[<p>I just wanted to share a little experience with generating an AS3 parser using <a href="http://www.antlr.org">antlr</a> and <a href="http://www.python.org">python</a>.<br />
I was trying first to create the parser using GNU <a title="gnu flex" href="http://www.gnu.org/software/flex/" target="_blank">Flex</a> and <a title="gnu bison" href="http://www.gnu.org/software/bison/" target="_blank">Bison</a> in C, probably the best way for a very performancing parser.<br />
Yeah, that&#8217;s right.. but looking at the antlr syntax I realized that&#8217;s easier and easier.<br />
Moreover I start using this very useful <a title="antlrstudio" href="http://www.placidsystems.com/antlrstudio.aspx" target="_blank">eclipse plugin</a> for antlr debugging which made my life easier!</p>
<p>The grammar file I created is a compromise between the <a title="as3.g" href="http://www.google.com/codesearch?hl=it&amp;q=+file:%5C.g%24+as3.g+show:gFeBx72kxIk:XKFG9i76Jiw:mSlmdOLa2XQ&amp;sa=N&amp;cd=1&amp;ct=rc&amp;cs_p=:pserver:anonymous%40aseclipseplugin.cvs.sourceforge.net:/cvsroot/aseclipseplugin+org.asdt.astview&amp;cs_f=src/org/asdt/core/internal/antlr/as3.g#a0" target="_blank">asdt grammar</a> file and the <a title="ECMA-262 specifications" href="http://www.ecma-international.org/publications/standards/Ecma-262.htm" target="_blank">ECMA-262 grammar</a> specification.</p>
<p>Once finished working on my eclipse project I&#8217;ve managed to parse succesfully all the adobe corelibs files using this java test file:<br />
<code lang="java">package org.sepy.core.parsers.as3;<br />
import java.io.File;<br />
import java.io.FileInputStream;<br />
import java.io.FileNotFoundException;<br />
import antlr.CommonAST;<br />
import antlr.RecognitionException;<br />
import antlr.TokenStreamException;<br />
public class Application {<br />
public static void main(String argv[])<br />
{<br />
if(argv.length &gt; 0)<br />
{<br />
File file = new File(argv[0]);<br />
if(file.exists())<br />
{<br />
FileInputStream is = null;<br />
try {<br />
is = new FileInputStream(file);<br />
} catch (FileNotFoundException e) {<br />
// TODO Auto-generated catch block<br />
e.printStackTrace();<br />
}<br />
AS3Lexer L = new AS3Lexer(is);<br />
AS3Parser P = new AS3Parser(L);<br />
try {<br />
P.compilationUnit();<br />
} catch (RecognitionException e) {<br />
// TODO Auto-generated catch block<br />
System.out.println(" line=" + e.line + ", column="+ e.column);<br />
System.out.println(e.getMessage());<br />
e.printStackTrace(System.err);<br />
} catch (TokenStreamException e) {<br />
// TODO Auto-generated catch block<br />
System.out.println(" line=" + L.getLine() + ", column="+ L.getColumn());<br />
System.out.println(L.getGuessInfo());<br />
System.out.println(e.getMessage());<br />
e.printStackTrace(System.err);<br />
}<br />
CommonAST.setVerboseStringConversion(false, P.getTokenNames());<br />
CommonAST ast = (CommonAST) P.getAST();<br />
System.out.println("Tree:");<br />
System.out.println(ast.toStringTree());<br />
}<br />
}<br />
}<br />
}</code><br />
Ok, done that I decided to export the grammar file for python (thanks to antrl python export feature).<br />
Everything works fine also for python, but I realized that the python script were so much slower than the java one!<br />
<code lang="python">import sys<br />
import antlr<br />
import AS3Parser<br />
import AS3Lexer<br />
L = AS3Lexer.Lexer(filename);<br />
P = AS3Parser.Parser(L);<br />
P.setFilename(filename)<br />
try:<br />
   P.compilationUnit();<br />
   ast = P.getAST();<br />
except:<br />
   pass<br />
</code><br />
On a 75Kb actionscript file the python script took about 7 seconds to run, while the java application only 2 seconds. I know python interpreter caould be slower than many other languages, but I never thought so much slower.<br />
So I run the python <a href="http://docs.python.org/lib/module-hotshot.html" target="_blank">hotshot profiler</a> to see which could be the bottleneck in the python script and I found most of the problems were due to unuseless antlr (the python module) method&#8217;s calls.<br />
After making corrections to the antlr.py file the same script took exactly half of the time. Now 3 seconds. Wow 🙂<br />
But not fast enough.<br />
So I enabled for the antlr python script <a href="http://psyco.sourceforge.net/" target="_blank">psyco</a> module and this time the same script took <strong>only 1.6 seconds.</strong><br />
Now the python script is fast enough, even if I&#8217;m sure I can make more optimizations in the antlr module&#8230;</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.sephiroth.it/2006/12/01/an-experience-with-antlr-java-and-python/feed/</wfw:commentRss>
			<slash:comments>3</slash:comments>
		
		
			</item>
		<item>
		<title>Debugging PHP with XDebug</title>
		<link>https://blog.sephiroth.it/2006/02/16/debugging-php-with-xdebug/</link>
					<comments>https://blog.sephiroth.it/2006/02/16/debugging-php-with-xdebug/#respond</comments>
		
		<dc:creator><![CDATA[Alessandro Crugnola]]></dc:creator>
		<pubDate>Thu, 16 Feb 2006 18:53:54 +0000</pubDate>
				<category><![CDATA[php]]></category>
		<category><![CDATA[debug]]></category>
		<category><![CDATA[profiler]]></category>
		<category><![CDATA[traceback]]></category>
		<category><![CDATA[xdebug]]></category>
		<guid isPermaLink="false">http://blog.sephiroth.it/?p=129</guid>

					<description><![CDATA[In these days, working with PHP after a lot of time, I&#8217;ve installed this cool tool for debugging PHP (it supports both PHP 4 and 5). XDebug is really useful for debugging PHP, which is usually not really easy to debug, and also easy to install. It provides a lot of valuable debug informations, for &#8230; <a href="https://blog.sephiroth.it/2006/02/16/debugging-php-with-xdebug/" class="more-link">Continue reading <span class="screen-reader-text">Debugging PHP with XDebug</span></a>]]></description>
										<content:encoded><![CDATA[<p>In these days, working with PHP after a lot of time, I&#8217;ve installed this cool tool for debugging PHP (it supports both PHP 4 and 5).<br />
XDebug is really useful for debugging PHP, which is usually not really easy to debug, and also easy to install.<br />
It provides a lot of valuable debug informations, for example a full <a href="http://www.xdebug.org/screens.php">traceback for errors</a>, <a href="http://www.xdebug.org/docs-profiling.php">profilig</a> with memory and CPU usage, <a href="http://www.xdebug.org/docs-functions.php#profiling">profiling functions </a>, etc..<br />
I really suggest to take a look at it!<br />
Both Windows and Linux versions are available for download<br />
<a href="http://www.xdebug.org">http://www.xdebug.org</a></p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.sephiroth.it/2006/02/16/debugging-php-with-xdebug/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
