Discussion Forums

Re: Improving FAST
Dale Wilson / Object Computing, Inc
25 Feb 2010 10:47AM ET

Continuing my suggestions for improving FAST...

Dynamic memory allocation can be a real performance killer. In C++ there are a number of techniques that can be used to avoid dynamic memory allocation or minimize its impact including keeping thread-specific memory pools and caching objects for re-use rather than deleteing/newing them, etc.

The one technique I would like to use, however, eliminates dynamic memory allocation altogether. That is preallocating space for the largest possible message. I have been able to use this with data feeds from particular sources to achieve some dramatic results. However, given the current definition of FAST templates there is no way to achieve these results in the general case, because there is no way to determine what "the largest possible message" is.

So my suggestion is add upper-bound information to field instructions that produce variable sized objects. In particular, the sequence, string, and byte vector instructions could have a bound="n" attribute that would be a commitment by the data source/template author that field being transmitted would never exceed 'n' elements. This information is often available to the data source/encoder. Making it available in the template would give the decoder the information it needs to avoid dynamic allocation in the general case.

Of course this would be an optional attribute with the default being that the number of elements is unbounded (or at least indeterminate.)

Dale
--
Principal Software Engineer
Object Computing, Inc (www.ociweb.com)
Lead Developer of the QuickFAST Open Source C++ implementation of the FAST protocol. (www.quickfast.org)


Improving FAST
Dale Wilson / Object Computing, Inc   29 Jan 2010 11:09AM ET
Re: Improving FAST
Rolf Andersson / Pantor Engineering   29 Jan 2010 12:33PM ET
Re: Improving FAST
Majkara Majka / me   2 Feb 2010 9:59AM ET
Re: Improving FAST
Dale Wilson / Object Computing, Inc   25 Feb 2010 10:47AM ET
Re: Improving FAST
Rolf Andersson / Pantor Engineering   25 Feb 2010 12:03PM ET
Re: Improving FAST
Dale Wilson / Object Computing, Inc   25 Feb 2010 12:34PM ET
Re: Improving FAST
Marc Battyani / HPC Platform   25 Feb 2010 1:45PM ET