[mercury-users] Re: (the lack of) unique modes
Tomas By
tomas at research.nj.nec.com
Fri Nov 5 03:41:11 AEDT 1999
Fergus Henderson writes:
> Sounds likely, but I suggest you try profiling your program
> with both time profiling and memory profiling (including
> calling io__report_full_memory_stats from the end of main/2),
> so that you can be sure about what is slowing it down.
I did the profiling bit and it didn't really tell me that much...
One of the map procedures (update I think) used about 25% of both
time and memory, but I'm not sure that ought to be surprising.
> Yes, unique modes would probably help. If all of those map(int, ...)
> are dense, then you could use arrays rather than maps. That would
> probably help a lot.
No, they're not dense...
> [...] we've also been doing some other optimizations that may improve
> performance for programs like that. Our latest development version
> includes improvements to the efficiency of compare/3 on polymorphic
> types, which is used heavily by the `map' implementation.
> We've also added support for user-guided type specialization, so
> that you can add pragmas to get the compiler to specialize such
> polymorphic data types for the particular cases that you use,
> thus avoiding the costs of polymorphism.
Do you think poymorphism is the/a major problem? Rather than not using
unique modes?
/Tomas
--------------------------------------------------------------------------
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