Faster Ferns

I have modified the fern input parameters in the spreadsheet presented in the previous post to match the layout used by Barnsley and others, so that examples such as those given at the Wikipedia article can be entered directly.  The new file can be downloaded from: Fern :

Modified Fern Parameter Input

In doing so I also tidied up the VBA matrix multiplication algorithm, and compared it with using the worksheetfunction.MMULT function.  The example above is for calculating and plotting 1 million rows, using Excel 2010.  It can be seen that:

  • The VBA function is about 7 times faster than using the built-in function.
  • Transferring the data from VBA to the spreadsheet takes about 50% longer than it does to generate the data.
  • Plotting the data remains very slow, taking nearly 90% of the total time. (time for plotting the 1 million point chart was about 10 seconds the first time, and about 20 seconds thereafter.  It seems likely there is scope for considerable improvements here in future releases).

Edit 4th Oct 10: I meant to mention that the times recorded here were done on a Dell laptop computer with an Intel P8700 processor (2.53 GHz) and 4 MB RAM, and with a finite element analysis program running in the background, using the full resources of one core virtually all the time.  Re-running without any hungry background processes made virtually no difference to the VBA running time (as would be expected since VBA only uses one core), but also made very little difference to the times for the calculation using the MMULT function, or for the re-plotting time.  That is surprising since Microsoft say they put a lot of effort into improving the performance of Excel 2010 (compared with 2007).  It looks to me like there is plenty of scope for further improvement here.

Times for plotting 40,000 rows are shown below:

Plot times for 40,000 rows

The Wikipedia article links to more examples at: .  Some of the different fern varieties reported in that paper have been plotted in the spreadsheet:

Parameters for four different fern types

Modified Barnsley Fern

Culcita Dubia

"Fishbone" Fern

Cyclosorus Fern

This entry was posted in Arrays, Charts, Charts, Drawing, Excel, Maths, Newton, VBA and tagged , , , . Bookmark the permalink.

4 Responses to Faster Ferns

  1. Pingback: 3 year report | Newton Excel Bach, not (just) an Excel Blog

  2. Oli says:


    Having read your previous post on the fractal ferns and taken inspiration – I thought I would post my results. I used these as projects for a course I am taking on Excel.

    The first is a worksheet formula:

    and the second uses a UDF that I have developed to plot a Barnsley fern.

    I hope you find these of interest. Although they are limited to one type I found them a fun and interesting project.

    PS I am not a mathematician nor am I an Engineer so alot of this blog goes way over my head 🙂
    Good work though!


  3. dougaj4 says:

    Thanks for sharing Oli.

    The blog did get a bit engineering heavy last year! I hope to do more general Excel stuff this year (but mostly it depends on what crops up at work, or what grabs my interest elsewhere).


  4. Pingback: Daily Download 8: Drawing in Excel | Newton Excel Bach, not (just) an Excel Blog

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.