Home of: [Atelier "FUJIGURUMA"] >> [PageMixer hosted by SourceForge.net]

SEE "For Readers of English Version",
or Japanese version of this page

Token consuming

This section explains the reason to invoke Consumer#consume method per each token.

Class names

In this document, abbreviated class names are used. Complete names are shown below.

NotationFull name
Consumer jp.ne.dti.lares.foozy.pagemixer.mixer.Consumer
Token jp.ne.dti.lares.foozy.pagemixer.Token

Ordinary design

Not only one of data but also data in bulk are passed between subjects, if it is well known that large amount of data is processed.

For example, data are passed as the array or the list consists of them, and it reduces costs to invoke methods on each of data.

Decision in PageMixer

Once I compared performance between invocation per Token and one in bulk.

At least at that time, per Token invocation was faster than one in bulk, because creation of intermediate array or list object may cost much. Creation of object seems to cost much ordinarily.

And it is reason why Consumer#consume is designed to be invoken per Token.