Re: Profiling Under Windows & String Size
- Posted by Robert Craig <rds at ATTCANADA.NET> Aug 04, 1999
- 519 views
David Guy writes: > 1) What was the reason time profiling was not > implemented in Euphoria for Windows? Is it > because the timer could not be re-programmed as it > could under DOS? If so, why couldn't timeGetTime() or > QueryPerformanceCounter() be used? In DOS, for profile_time, Euphoria takes control of the clock interrupt. Every 1/100 (or whatever) of a second, a routine in the interpreter gets control. It records the address in your Euphoria program where you are currently executing. At the end of execution, these machine addresses are analysed, and related back to statement numbers in your program. I have not figured out how to get regular interrupts of this granularity under Windows. There is probably a way to do it. If anyone knows how to do it please let me know. The routines that you mention don't do what I want. > 2) In the documentation it states a "string" is simply a > sequence of numbers. Does this mean each character > takes 4-bytes of memory, or does Euphoria store them in > single bytes until it has some compelling reason to do > otherwise? They take 4 bytes. This has been discussed before. It would be nice if they could only take one byte, and I've spent a good deal of time looking for a convenient way to do this. Unfortunately, any 1-byte scheme seems to have the following disadvantages: * It makes the interpreter bigger, thereby wasting some of the space you are trying to save. * It makes the interpreter a few percent slower. * It makes the interpreter more susceptible to bugs. * It makes the interpreter harder to maintain Regards, Rob Craig Rapid Deployment Software http://members.aol.com/FilesEu/