Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
for performance, what's the best variable type to use for boolean _TRUE & _FALSE ?
#4
(09-20-2025, 07:17 PM)madscijr Wrote: Thanks - so reading over that, it sounds like _BYTE would be the most efficient type for performance and space, where _BIT would require unpacking under the hood. Do I have that right?


     I doubt _byte is the most performant.     Everything I know about computer architecture tells me on a 64 bit system that _INTEGER64 will be the fastest.    
On a 32 bit system it would be LONG ...     _byte is the best for memory usage.   

    That said,   I doubt there's any performance hit you would notice using any Integer Type or even Single or Double.   We are talking about stuff that's a rounding error on almost all modern systems.      Myself.   I tend to use INTEGER for my personal Boolean type.   This is mostly because I write code for a couple of different Flavors of BASIC and this seems a good common denominator for me !

Also if you do want to use an _INTEGER64 for the possible speed benefit. I wouldn't worry about the 8 bytes of memory. Like I said. That's a rounding error !
Reply


Messages In This Thread
RE: for performance, what's the best variable type to use for boolean _TRUE & _FALSE ? - by ahenry3068 - 09-20-2025, 08:23 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
Question Experimenting with a "StringList" type for simpler handling of string arrays/lists Heimdall 18 1,183 12-19-2025, 12:51 PM
Last Post: Heimdall
  performance drop on LINUX with PSET in v4.2 Herve 12 942 11-20-2025, 02:00 PM
Last Post: SpriggsySpriggs
  Loading from file into _MEM? and LEN a TYPE... Unseen Machine 9 958 08-03-2025, 02:55 AM
Last Post: SMcNeill
  Need help with boolean Petr 6 1,122 11-17-2024, 06:57 AM
Last Post: TempodiBasic
  QB64's TYPE / END TYPE inquiry MystikShadows 2 890 06-30-2024, 02:34 PM
Last Post: MystikShadows

Forum Jump:


Users browsing this thread: 1 Guest(s)