Path: news.cs.au.dk!not-for-mail From: Morten Grouleff Newsgroups: comp.lang.beta Subject: Re: Speeding up BETA Date: 4 May 1999 13:04:50 -0000 Organization: University of Aarhus, Department of Computer Science (DAIMI) Lines: 27 Approved: mailtonews@cs.au.dk Distribution: world Message-ID: <19990504130450.11074.qmail@noatun.mjolner.dk> Reply-To: Morten Grouleff NNTP-Posting-Host: daimi.cs.au.dk X-Trace: xinwen.cs.au.dk 925823106 2161865 255.255.255.255 (4 May 1999 13:05:06 GMT) X-Complaints-To: news@cs.au.dk NNTP-Posting-Date: 4 May 1999 13:05:06 GMT Xref: news.cs.au.dk comp.lang.beta:11919 Daniel Bonniot writes: > > > Are there good reasons _not_ to use a single object > > > instantiated from a built-in pattern, like the above, in > > > "real" programs? > > > > For patterns like putline, no. But the pattern must be able to handle > > it: Some patterns depend on the fact that their local attributes are > > initialized (to zero, empty string, false depending on the type). This > > is done at allocation, so calling it twice might make such patterns > > behave badly. > > OK but this could be done by explicitly initializing local attributes. Yes, but that could easily end up taking more time, as the initialization done by the allocation is very efficient. > Isn't there a harder problem for concurent threads ? If two threads > called the single object, the two executions would share local > attributes, which could lead to errors. True. Another potential problem is that it keeps the object alive longer than it probably needs, leading to increased memory usage. -- ** Morten Grouleff: ** ** Earthworm Jim PC: ** ** Mjølner Informatics: **