Boolean

A Boolean data type is a data type with only two possible values: true or false.

Int

A data type that represents an integer

Memory heap space

Quality | Example |
---|---|

More memory |
"Int occupy more memory than boolean so the heap got corrupted" from question "HEAP CORRUPTION DETECTED: after Normal block (#143)" |

Less space |
"A boolean takes less space than an int" from question "Advantages of BooleanProperty in GAE NDB" |

Type numeric better

Quality | Example |
---|---|

Better |
"Perhaps using int type if values are all numeric would work better than boolean for a and b" from question "Boolean Array Value Comparison" |

Array more |
"But counting the number of trues in a boolean array is more difficult since the accumulated type int differs from the source type bool" from question "LINQ Aggregate algorithm explained" |

Value efficient existence

Quality | Example |
---|---|

More space |
"Would a boolean array of size 32 take more space than an int variable for example" from question "Does a boolean array take more space than a number of the same size?" |

Less space |
"It is saying this because using the int to store the value 32 bits is going to use less space than a boolean 256 as each allocated boolean will take up 8 bits 8 256 2048" from question "Java: bit vector vs. boolean array" |

More efficient |
"I always assumed that boolean were more efficient than int at storing an on off value - considering that s their reason for existence" from question "Boolean vs Int in Javascript" |

Time a.length consuming

Quality | Example |
---|---|

More time |
"Since the logic is the same i thought evaluating boolean objects takes more time than int equivalence true 1 and false 0 therefore i came up with the following benchmark and it turns out that i was correct" from question "Why evaluating boolean objects takes time in python" |

More |
"However the second loop causes the additional task of casting each of the values between a.length and 0 to a boolean which is more time consuming than int comparison" from question "Why is there a performance difference between these two reverse loops?" |

Others