From maintainers-request at octave dot org Thu Feb 10 04:24:30 2005 Subject: Re: strace of exist function for a variable From: David Bateman To: maintainers at octave dot org Cc: Mohamed kamoun Date: Thu, 10 Feb 2005 11:26:02 +0100 This is a multi-part message in MIME format. --------------070208040204030005030802 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit David Bateman wrote: > Has any one tried to do an strace of octave while running the exist > function. It appears that exist("","var") will search the patch > for dot-m and oct-files even though a variable was explicitly asked > for. This certainly makes this significantly slower than it needs to > be. Also, strace > appears to show that the path is being searched twice, by exist!! It > seems to me that there are some rather simple improvements in the > speed of the exist function that might be made... > > Regards > David > What about the following trivial fix for this problem.. 2005-02-10 David Bateman * variables.cc (symbol_exist): Don't search path if explicitly asked for a variable or builtin Regards David -- David Bateman David dot Bateman at motorola dot com Motorola Labs - Paris +33 1 69 35 48 04 (Ph) Parc Les Algorithmes, Commune de St Aubin +33 1 69 35 77 01 (Fax) 91193 Gif-Sur-Yvette FRANCE The information contained in this communication has been classified as: [x] General Business Information [ ] Motorola Internal Use Only [ ] Motorola Confidential Proprietary --------------070208040204030005030802 Content-Type: text/plain; name="patch-exist_20050210" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="patch-exist_20050210" *** src/variables.cc~ 2004-12-28 02:59:05.000000000 +0100 --- src/variables.cc 2005-02-10 11:21:07.299369002 +0100 *************** *** 823,828 **** --- 823,831 ---- } } + if (type == "var" || type == "builtin") + retval = 0; + if (! retval) { string_vector names (2); --------------070208040204030005030802--