[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Efficiency of generic programming

This page is part of the web mail archives of SRFI 76 from before July 7th, 2015. The new archives for SRFI 76 contain all messages, not just those from before July 7th, 2015.



I have a concern with the efficiency of the current interface for reflection. Some simple, and rather important or canonical, generic operations will be rather less efficient than they could be.

- Polymorphic copying and update will be slow:

  Requires lookup of record-type-field-names, which is a list, determining the
  length of this list, which is o(N), and only then can the accessors/mutators
  be obtained by index.

I believe this could be fixed by either having RECORD-TYPE-FIELD-NAMES return a vector, or having a RECORD-LENGTH primitive.

Cheers
Andre