[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: all-XSLT implementation of Minesweeper

Subject: Re: all-XSLT implementation of Minesweeper
From: David Carlisle <davidc@xxxxxxxxx>
Date: Thu, 17 Mar 2005 12:12:11 GMT
xslt implementation of concat
  regarding speed, the performance seem to benefit when I changed 2 
  expressions from "//square" to "SweeperMap/square".  But the 
  performances varies a lot by how much free space there is on the map.  


similarly you have lots of expresions like this 

     +  count(//bomb[@h=$rowH -1 and @v=$rowV +1 ]) 


which are likely to be slow. Even if you change // to a more specific
path this cries out to use a key which would probably change the time
complexity of the algorithm completely as basically it tells the system
to use some space to make some kind of lookup table to find these things
quickly.

something like

<xsl:key name="bomb" match="bomb" use="concat(@h,':',@v)"/>

then replace the above by

     +  count(xsl:key('bomb',concat($rowH -1,':',$rowV +1)))

that said, it's a nice demo!!
Are you going to do freecell, solitaire and pinball  as well?

David


________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.