en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en de en en en en nl en en en en en en en en en en hbs_lat en en en de en de en en en en en nl en en en en en en en en fr en da en en en en en en en nl en en en en en de en en en en de en en en fr en en en en en en en en en pt en en en en en en
By logging into your account, you agree to our Privacy Policy, personal data processing and storage practices as described therein.
Forgot password or user name?
Search in titles only Search in Programming only
You are not logged in. You can browse in the PowerBASIC Community, but you must click Login (top right) before you can post. If this is your first visit, check out the FAQ or Sign Up.
All Time Today Last Week Last Month
All Discussions only Photos only Videos only Links only Polls only Events only
Join Date: Aug 2001
21 Jan 2008, 02:14 PM
I have been reading a big article about memory at http://lwn.net/Articles/250967/
After reading Part 5, it seems PB could benefit from the option to give the compiler hints about your code.
It should not be too hard to integrate into PB's syntax. A few examples of what it could look like.
IF EXPECT c%>127, EXPECT d%=55, c%<127 AND D% = 55 THEN DoSomething
IF EXPECT TRUE, NOT ErrorFlag THEN DoSomething
SUB DoSomething() HINT whatever ' hints about when and how often the SUB/FUNCTION is used
LOCAL MyCounter AS BYTE, MyName AS STRING
DIM A(2530) AS DOUBLE NONTEMPORAL ' don't let this array go into cache, perhaps it is rarely needed
Join Date: Aug 1998
21 Jan 2008, 03:34 PM
Frankly I think this stuff is ABSOLUTELY NOT part of any high-level language such as BASIC. To avoid thinking about this is why you licensed a high-level language compiler in the first place.
Besides, you already can set your program's working set size (keep stuff in memory); set the priority of any thread owned by your program; and follow the performance suggestions in the help file (eg, use LONG datatytypes and zero-based arrays).
Not to mention, if you already code like a doofus, this kind of thing is not going to help.
Port Washington WI USA
Join Date: Jun 1999
21 Jan 2008, 05:27 PM
you can usefully use your knowledge of how RAM and cache affect code speed by writing your programs with that in mind but I don't think it's something a compiler will ever do well. It's something best left to the programmer.
It's not often that you'll gain a lot anyway. The overhead of the compiler will usually swamp any gains. In the few cases where there is a significant amount to be gained then you'd be better off using ASM.
Copyright © 1998-2022 PowerBASIC Tools, LLC - All Rights Reserved.
Powered by vBulletin® Version 5.7.0
Copyright © 2022 vBulletin Solutions, Inc. All rights reserved.
All times are GMT-5. This page was generated at 02:28 AM.
We process personal data about users of our site, through the use of cookies and other technologies, to deliver our services, and to analyze site activity. For additional details, refer to our Privacy Policy.
By clicking "I AGREE" below, you agree to our Privacy Policy and our personal data processing and cookie practices as described therein. You also acknowledge that this forum may be hosted outside your country and you consent to the collection, storage, and processing of your data in the country where this forum is hosted.