[mercury-users] XML Parsing (fwd)
Michael Day
mikeday at corplink.com.au
Wed Jun 20 11:12:03 AEST 2001
> So you might get a big speed-up by making the routines monomorphically typed
> rather than polymorphically typed, or by using the user-guided type
> specialization pragmas (see the "pragmas" chapter in the language reference
> manual).
The predicate definition looks like this:
:- pred baseChar(pstate(T1), pstate(unicode)).
:- mode baseChar(pdi, puo) is det.
Making it monomorphically typed or using the type specialization pragmas
would require fixing T1 to a single type, I assume. This type would depend
on whoever is calling baseChar, which at the moment is letter, which is
also polymorphically typed.
letter is called by nameChar and name, which are called by nmtoken and
names, and so on as far as I can tell all the way up to document, which is
similar:
:- pred document(pstate(_), pstate((dtd, document))).
:- mode document(in, out) is det.
The first pstate comes from the pstate predicate, which emits a
pstate(''). None of the predicates called in tryit before document appear
to change the type of the pstate, so would it be safe (albeit annoying) to
change all the pstate(_) in those predicates to pstate('') and remove the
polymorphism and hopefully bring back speed and reduce compile time?
Michael
--------------------------------------------------------------------------
mercury-users mailing list
post: mercury-users at cs.mu.oz.au
administrative address: owner-mercury-users at cs.mu.oz.au
unsubscribe: Address: mercury-users-request at cs.mu.oz.au Message: unsubscribe
subscribe: Address: mercury-users-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------
More information about the users
mailing list