Skip to main content
Article thumbnail
Location of Repository

On the performance of parametric polymorphism in maple

By Laurentiu Dragan and Stephen M. Watt


With the introduction of support for generics in mainstream programming languages, we see an renewed interest in writing generic code. Maple offers the possibility to write generic code using module-producing functions. There is usually a performance cost associated with the use of generics, and this paper analyzes the cost of using these in Maple. We created sets of tests for different styles of generics and compared their performance with specialized Maple code. The first set of tests implemented generics in the style of parameterized abstract data types, with Maple modules providing functions that operated on data values. The second set of tests implemented generics in the style of parameterized object-oriented classes, where each data value was embodied in its own module object. The test functions were based on the popular SciMark benchmark for scientific computation in Java. The results show a small degradation of performance when using generics modeled on abstract data types and high performance degradation when using an object-oriented approach. Keywords. generics, parametric polymorphism, performance, Maple.

Year: 2006
OAI identifier: oai:CiteSeerX.psu:
Provided by: CiteSeerX
Download PDF:
Sorry, we are unable to provide the full text but you may find it at the following location(s):
  • (external link)
  • (external link)
  • Suggested articles

    To submit an update or takedown request for this paper, please submit an Update/Correction/Removal Request.