Skip to content
View in the app

A better way to browse. Learn more.

The AVSIM Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

More is better?

Featured Replies

Hi,In my quest for more efficient code, with as goal better FPS, which code is faster? (Got a lot of them!!) (L:condition,number) 100 < if{ (L:failure 1,bool) ! if{ 1 (>L:failure 1,bool) } (L:failure 2,bool) ! if{ 1 (>L:failure 2,bool) } etc. } els{ (L:failure 1,bool) if{ 0 (>L:failure 1,bool) } (L:failure 2,bool) if{ 0 (>L:failure 2,bool) } etc. } or(L:condition,number) 100 < if{ 1 (>L:failure 1,bool) 1 (>L:failure 2,bool) etc. } els{ 0 (>L:failure 1,bool) 0 (>L:failure 2,bool) etc. } Jan"Beatus ille qui procul negotiis..."

Jan

 

 

 

"Beatus ille qui procul negotiis..."

  • Author

Hi Jan,IMO the second construction would allways be more efficient, because, depending the actual valuea of the bool's, in the first construction either more stackoperations are needed or (in the final CPU code) a JMP instruction is executed.But for such simple code, you would 100.000+ (or more ?) of code lines to ever see an FPS difference.Moreover, construction-2 is simpler :-)I would only use Construction-1 when the code was generating FS9 events instead of setting variables. To prevent inducing the "continuous event" problem (which Construction-2 would do).Cheers, Rob

Thanks Rob,Now I shall continue with the "simple" ones.The "Events Firing problem" is history thanks to Doug.Jan"Beatus ille qui procul negotiis..."

Jan

 

 

 

"Beatus ille qui procul negotiis..."

Jan,This "third option" should be the most efficient:(L:condition,number) 100 < d (>L:failure 1,bool) (>L:failure 2,bool) etcproviding failure lvars must accept the same logical value of the first comparison (which may not be the case usually).Tom

  • Author

Hi Tom,Yes, as far as run-time efficiency is concerned: of course you are right!But I personally try to avoid constructions like that (i.e. do a test without it being followed by an IF contruction) because I find it makes the code less readable/understandable, and therefore less maintainable. Besides, it only works for booleans, not generic numbers.But I guess that's a matter of personal taste :-)And optimising for maintainability instead of efficiency is something I try to do for years now, because it happened too often to me, that, when I was adapting/extending a piece of tricky, but efficient code, I made stupid mistakes :-)Cheers, Rob

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.