Thread: Java Optimization/Boolean Logic Test

Page 3 of 4 FirstFirst 1234 LastLast
Results 21 to 30 of 32
  1. #21  
    Community Veteran


    Join Date
    Jan 2008
    Posts
    2,659
    Thanks given
    494
    Thanks received
    627
    Rep Power
    980
    I said this on MSCP (:trollface, a ternary statement is parsed as a single sequence by the compiler, while a if-else statement is two separate sequences. This means that the bytecode produced will be slightly different. @filth A ternary statement is not necessarily one instruction less. See: http://stackoverflow.com/questions/2...ate sequences.. Point is that it pushes a constant and then adds. With an if-else statement, iinc would be used instead.

    P.S. "sequence" may not be the right word. I suck at explaining.
    ~iKilem
    Reply With Quote  
     

  2. #22  
    Banned

    Join Date
    Mar 2008
    Posts
    2,595
    Thanks given
    128
    Thanks received
    191
    Rep Power
    0
    Quote Originally Posted by iKilem View Post
    I said this on MSCP (:trollface, a ternary statement is parsed as a single sequence by the compiler, while a if-else statement is two separate sequences. This means that the bytecode produced will be slightly different. @filth A ternary statement is not necessarily one instruction less. See: http://stackoverflow.com/questions/2...ate sequences.. Point is that it pushes a constant and then adds. With an if-else statement, iinc would be used instead.

    P.S. "sequence" may not be the right word. I suck at explaining.
    hence why i said 'in that case' on my first post and explained what the situation was with that specific example (if-else vs ternary setting value of variable), i'm perfectly aware of the differences, also no problem here officer the issue has been handled maggot has been put in his place
    Reply With Quote  
     

  3. #23  
    Community Veteran


    Join Date
    Jan 2008
    Posts
    2,659
    Thanks given
    494
    Thanks received
    627
    Rep Power
    980
    Quote Originally Posted by filth View Post
    hence why i said 'in that case' on my first post and explained what the situation was with that specific example (if-else vs ternary setting value of variable), i'm perfectly aware of the differences, also no problem here officer the issue has been handled maggot has been put in his place
    misread what you said, sorry.
    ~iKilem
    Reply With Quote  
     

  4. #24  
    Registered Member Killer 99's Avatar
    Join Date
    Dec 2007
    Posts
    1,480
    Thanks given
    171
    Thanks received
    503
    Rep Power
    414
    Holy FUCK

    Did you guys just disregard anything I said?
    Reply With Quote  
     

  5. #25  
    Registered Member Killer 99's Avatar
    Join Date
    Dec 2007
    Posts
    1,480
    Thanks given
    171
    Thanks received
    503
    Rep Power
    414
    Code:
    	public int f(boolean a, boolean b)
    	{
    		return (a ? 2:0) | (b ? 1:0);
    	}
    /end
    Reply With Quote  
     

  6. #26  
    Renown Programmer
    veer's Avatar
    Join Date
    Nov 2007
    Posts
    3,746
    Thanks given
    354
    Thanks received
    1,370
    Rep Power
    3032
    Quote Originally Posted by iKilem View Post
    I said this on MSCP (:trollface, a ternary statement is parsed as a single sequence by the compiler, while a if-else statement is two separate sequences. This means that the bytecode produced will be slightly different. @filth A ternary statement is not necessarily one instruction less. See: http://stackoverflow.com/questions/2...ate sequences.. Point is that it pushes a constant and then adds. With an if-else statement, iinc would be used instead.

    P.S. "sequence" may not be the right word. I suck at explaining.
    the only difference i see is that a ternary assignment uses only one store instruction which both branches merge to
    Reply With Quote  
     

  7. #27  
    Registered Member Killer 99's Avatar
    Join Date
    Dec 2007
    Posts
    1,480
    Thanks given
    171
    Thanks received
    503
    Rep Power
    414
    Why in Aj's name has this been moved to the tutorials section?
    Reply With Quote  
     

  8. #28  
    Banned

    Join Date
    Mar 2008
    Posts
    2,595
    Thanks given
    128
    Thanks received
    191
    Rep Power
    0
    Quote Originally Posted by Killer 99 View Post
    Why in Aj's name has this been moved to the tutorials section?
    cuz this is tutorial???????? :trollface:

    i learned how to do boolean optimization!
    Reply With Quote  
     

  9. #29  
    fumant viriditas quotidiana

    saifix's Avatar
    Join Date
    Feb 2009
    Age
    30
    Posts
    1,237
    Thanks given
    275
    Thanks received
    957
    Rep Power
    3304
    i learned how to obfuscate while my parents procreate
    "Im so bluezd out of my box.
    Im so fkd i canr even sens makeas Smoke blunt 420hash e tizday" - A legendary guy (1993 - 2015)
    Quote Originally Posted by nmopal View Post
    I will be creating a grimy dubstep song using these lyrics and vocaloid please prepare your bodies
    Reply With Quote  
     

  10. #30  
    Registered Member thiefmn6092's Avatar
    Join Date
    Dec 2006
    Age
    24
    Posts
    2
    Thanks given
    26
    Thanks received
    389
    Rep Power
    0
    Quote Originally Posted by saifix_ View Post
    i learned how to obfuscate while my parents procreate
    i feel so great being straight
    Reply With Quote  
     

Page 3 of 4 FirstFirst 1234 LastLast

Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. [Test Your Java Skills] Major flaw in PI
    By Debugger in forum Help
    Replies: 34
    Last Post: 12-03-2010, 03:10 AM
  2. Player updating optimization.
    By Maxi in forum Snippets
    Replies: 6
    Last Post: 04-03-2010, 10:44 PM
  3. Runescape Text Optimization.
    By bloodargon in forum Snippets
    Replies: 7
    Last Post: 09-26-2009, 04:09 AM
  4. Server Java Knowledge test.
    By Colby in forum RS2 Server
    Replies: 5
    Last Post: 06-10-2009, 08:25 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •