| 11-07-2007, 11:47 PM | #1 |
Out of '<=, >=, >, and <', which one is the fastest? |
| 11-07-2007, 11:55 PM | #2 |
lol. |
| 11-07-2007, 11:59 PM | #3 |
You're kidding right? Please god say you're making a funny? |
| 11-08-2007, 12:15 AM | #4 |
<= is the fastest |
| 11-08-2007, 12:17 AM | #5 |
Laugh until you remember this is Blizzard we're talking about. 1. JASS is compiled down to a bytecode. In grimoire/src/opcode.h you'll find: Code:
OP_EQUALS=0x1A,OP_LESSEREQUAL=0x1C,OP_GREATEREQUAL=0x1D,OP_LESSER=0x1E,OP_GREATER=0x1F 2. Now, while JASS the language is statically typed, the VM was implemented with dynamic typing. This doesn't matter for <= vs <, but for <= vs == you can imagine it could, as there is a new choice to dick with, the handle. 3. <= vs < is essentially identical. For each type, the same comparison instruction is used with a different interpretation of the resulting flags. Oddly, for reals, they use the floating point instructions of the machines rather than their emulation library. One nice thing about this is that the semantics of not > should be identical to <=; note that not == and != are different! 4. You have the tools to answer questions of speed for yourself, so go test, and tell us if there are any surprises. |
| 11-08-2007, 12:20 AM | #6 |
I just got tired, forget about it.. |
| 11-08-2007, 12:30 AM | #7 |
No, and I don't necessarily agree that for floating point numbers >= as the complement to < is the only reasonable definition. |
| 11-08-2007, 02:33 AM | #8 |
Who the hell cares anyway? Its not like you can choose between them. Either your code needs one or another I can't imagine a time when I thought I could use many different ones. Even if there is a case it is likely that the shortest in code length would be obvious. |
| 11-08-2007, 03:17 AM | #9 |
Well I sort of want to understand how it works better, so yes, I was serious. Being told that boolean checks used the same power as string checks lead up to this. Not familiar enough with Grimoire to use it, I have it yea, but don't use it. You made that right Pipe? Maybe pitzer... |
