From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,f6f130eea077b8f8 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-05-22 23:09:30 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!cyclone.bc.net!news-hog.berkeley.edu!ucberkeley!nntp-relay.ihug.net!ihug.co.nz!small1.nntp.aus1.giganews.com!nntp.giganews.com!nntp3.aus1.giganews.com!nntp.clear.net.nz!news.clear.net.nz.POSTED!not-for-mail NNTP-Posting-Date: Fri, 23 May 2003 01:11:18 -0500 From: Craig Carey Newsgroups: comp.lang.ada Subject: Re: 'Write attribute vs Write procedure. Date: Fri, 23 May 2003 18:09:25 +1200 Message-ID: References: X-Newsreader: Forte Agent 1.92/32.572 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Organization: Customer of Mercury Telecommunications Ltd Cache-Post-Path: drone5.qsi.net.nz!unknown@tnt1-511.quicksilver.net.nz X-Cache: nntpcache 2.4.0b5 (see http://www.nntpcache.org/) X-Original-NNTP-Posting-Host: drone5-svc-skyt.qsi.net.nz X-Original-Trace: 23 May 2003 18:09:24 +1200, drone5-svc-skyt.qsi.net.nz NNTP-Posting-Host: 203.97.37.6 X-Trace: sv3-ltXiZxW4m7wgMH90prx3kJ1rAc6oYFG+ocpu29+WKP1Puy669xL0V5gyK8QpA9bPtvu8BKYIjMMVQat!2M9niA0HQN8HFJc0Uh4GOpr7SDZxjIex6Zl4iVnDUt2aYxBHN4h1RPNBaqePpASHQaPX4HRvVQYK!tfOYEss= X-Complaints-To: Complaints to abuse@clear.net.nz X-DMCA-Complaints-To: Complaints to abuse@clear.net.nz X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.1 Xref: archiver1.google.com comp.lang.ada:37668 Date: 2003-05-23T18:09:25+12:00 List-Id: On Wed, 21 May 2003 00:42:33 GMT, tmoran@acm.org wrote: >> Write (This.Link.all, >> Buffer (1 .. Stream_element_offset (Chunk))); >> Stream_element_array'Write (This.Link, >> Buffer (1 .. Stream_element_offset (Chunk))); >>... >> the Write procedure is taking no noticeable amount of time/cpu. >>In the contrary, the 'Write attribute takes like 3-4 seconds of 100% CPU > Perhaps Gnat's 'Write is doing one 'Write(Stream_Element) call for >each element of the Buffer, vs a single call for the whole thing in >the procedure version? Since you've already got a Stream_Element_Array, >perhaps you could call > Ada.Streams.Write(Ada.Streams.Root_Stream_Type'class(This.Link), > Buffer (1 .. Stream_element_offset (Chunk))); >directly? > Personally, I think using the default 'write is only reasonable >in the very simplest cases. [...] X'Write() would have to come out best in a comparison involving at least two choices. Some other principle, presumably something 'unreasonable', shows up when there is not much Ada 95 code. -- PS. GNAT is allocating tracking numbers for requests on GNAT.Sockets, including for requests for big rewrites. ACT might not be planning on rewriting the package (I don't know). I got this subject header back: "[C516-004 public] Programming style of exception raising in GNAT.Sockets, etc." So similarly, GNAT.Sockets could be altered so that the comments in it suggesting use of Ada 95's X'Read feature, are deleted or discouraged. X'Read() has no parameter for diagnostics on what the malfunction was. The language can be revised so that X'Read is deleted or else it returns error information out directly so that it is available to very next line in the source code. If Ada becomes a language where malfunctioning programs don't know why, and are really cryptic in describing the precise problem (e.g. since code in exception handlers tries to handle too many errors), then it could be all made reasonable (insufficiently reasonable) by the new style of new unneeded code that seems to do ntohing to a single byte but just lose the error info so that the next line can't get it (it has to be the line after if the code is in an exception handler). However ACT is saying that customers do not seek big changes in GNAT.Sockets. Craig Carey http://www.ijs.co.nz/ada_95.htm <- mailing lists