Jump to content

  • Log In with Google      Sign In   
  • Create Account

#Actualfrob

Posted 19 February 2014 - 12:54 PM

I imagine things are different for 3D graphically intensive AAA games... but for my 2D indie game, I can always optimize one function, or write a specialized function, when needed.

 

That is the great difficulty about optimization.

 

Every programmer, including me on many occasions, has followed that advice. It is often good advice because most code isn't a major bottleneck. "We don't need to specialize the functionality for performance, so this time we'll use the generic version. If this time is particularly bad we can optimize it later." Less work up front, probably never an issue.

 

The closest common expression is "death by a thousand cuts".

 

It isn't the individual slowness that is the problem. 

 

Using a function to calculate it instead of a bit of direct code to calculate. That's fine, it adds a few nanoseconds, but understandable for clarity...

Using accessor functions rather than reading the element directly. That's also fine, it adds a few nanoseconds, but understandable for reuse...

Using virtual functions to allow classes to be customized. Sure it has a cost of a few nanoseconds, but if every subclass must follow different behavior it can be cheaper than the comparisons involved on a piecemeal solution...

Using a function to combine the funcationality to a single place. That's fine, it adds a few nanoseconds, but understandable for readability...

Putting all that in a loop. That's fine, we need to loop, it is understandable because there are more than one...

Copying the pattern into several systems. Well, okay, just be aware that the tiny inefficiencies are multiplying...

 

 

When I run a profiler and see a giant function sucking down microseconds, I love it. Easiest fix ever.

 

When I run a profiler and see a small function being called many thousand times, I enjoy it. I can isolate it, do some search-and-replace, maybe move something around, maybe inline something. Not hard, do the work and call the job done.

 

When I run a profiler and see a common pattern is being wasteful, I can figure out a fix, email the team to watch for it, hunt down bad offenders, and spend a few days trying to clean up. It is work, but part of the job description; not every day is unicorns and rainbows.

 

When I run a profiler and see nothing that stands out, but there are thousands of tiny inefficiencies that each require individual assessment, I start having nightmares and consider following a career advancement opportunity elsewhere.


#4frob

Posted 19 February 2014 - 12:51 PM

I imagine things are different for 3D graphically intensive AAA games... but for my 2D indie game, I can always optimize one function, or write a specialized function, when needed.

 

That is the great difficulty about optimization.

 

We don't need to specialize the functionality for performance, so this time we'll use the generic version. If this time is particularly bad we can optimize it later.

 

The closest common expression is "death by a thousand cuts".

 

It isn't the individual slowness that is the problem. 

 

Using a function to calculate it instead of a bit of direct code to calculate. That's fine, it adds a few nanoseconds, but understandable for clarity...

Using accessor functions rather than reading the element directly. That's also fine, it adds a few nanoseconds, but understandable for reuse...

Using virtual functions to allow classes to be customized. Sure it has a cost of a few nanoseconds, but if every subclass must follow different behavior it can be cheaper than the comparisons involved on a piecemeal solution...

Using a function to combine the funcationality to a single place. That's fine, it adds a few nanoseconds, but understandable for readability...

Putting all that in a loop. That's fine, we need to loop, it is understandable because there are more than one...

Copying the pattern into several systems. Well, okay, just be aware that the tiny inefficiencies are multiplying...

 

 

When I run a profiler and see a giant function sucking down microseconds, I love it. Easiest fix ever.

 

When I run a profiler and see a small function being called many thousand times, I enjoy it. I can isolate it, do some search-and-replace, maybe move something around, maybe inline something. Not hard, do the work and call the job done.

 

When I run a profiler and see a common pattern is being wasteful, I can figure out a fix, email the team to watch for it, hunt down bad offenders, and spend a few days trying to clean up. It is work, but part of the job description; not every day is unicorns and rainbows.

 

When I run a profiler and see nothing that stands out, but there are thousands of tiny inefficiencies that each require individual assessment, I start having nightmares and consider following a career advancement opportunity elsewhere.


#3frob

Posted 19 February 2014 - 12:49 PM

I imagine things are different for 3D graphically intensive AAA games... but for my 2D indie game, I can always optimize one function, or write a specialized function, when needed.

 

That is the great difficulty about optimization.

 

We don't need to specialize the functionality for performance, so this time we'll use the generic version. If this time is particularly bad we can optimize it later.

 

The closest common expression is "death by a thousand cuts".

 

It isn't the individual slowness that is the problem. 

 

Using a function to calculate it instead of a bit of direct code to calculate. That's fine, it adds a few nanoseconds, but understandable for clarity...

Using accessor functions rather than reading the element directly. That's also fine, it adds a few nanoseconds, but understandable for reuse...

Using virtual functions to allow classes to be customized. Sure it has a cost of a few nanoseconds, but if every subclass must follow different behavior it can be cheaper than the comparisons involved on a piecemeal solution...

Using a function to combine the funcationality to a single place. That's fine, it adds a few nanoseconds, but understandable for readability...

Putting all that in a loop. That's fine, we need to loop, it is understandable because there are more than one...

Copying the pattern into several systems. Well, okay, just be aware that the tiny inefficiencies are multiplying...

 

 

When I run a profiler and see a giant function sucking down microseconds, I love it. Easiest fix ever.

 

When I run a profiler and see a small function being called many thousand times, I enjoy it. I can isolate it, do some search-and-replace, and call the job done.

 

When I run a profiler and see a common pattern is being wasteful, I can figure out a fix, email the team to watch for it, hunt down bad offenders, and spend a few days trying to clean up. It is work, but part of the job description; not every day is unicorns and rainbows.

 

When I run a profiler and see nothing that stands out, but there are thousands of tiny inefficiencies that each require individual assessment, I start having nightmares and consider following a career advancement opportunity elsewhere.


#2frob

Posted 19 February 2014 - 12:47 PM

I imagine things are different for 3D graphically intensive AAA games... but for my 2D indie game, I can always optimize one function, or write a specialized function, when needed.

 

That is the great difficulty about optimization.

 

We don't need to specialize the functionality for performance, so this time we'll use the generic version. If this time is particularly bad we can optimize it later.

 

The closest common expression is "death by a thousand cuts".

 

It isn't the individual slowness that is the problem. 

 

Using a function to calculate it instead of a bit of direct code to calculate. That's fine, it adds a few nanoseconds, but understandable for clarity...

Using accessor functions rather than reading the element directly. That's also fine, it adds a few nanoseconds, but understandable for reuse...

Using virtual functions to allow classes to be customized. Sure it has a cost of a few nanoseconds, but if every subclass must follow different behavior it can be cheaper than the comparisons involved on a piecemeal solution...

Using a function to combine the funcationality to a single place. That's fine, it adds a few nanoseconds, but understandable for readability...

Putting all that in a loop. That's fine, we need to loop, it is understandable because there are more than one...

Copying the pattern into several systems. Well, okay, just be aware that the tiny inefficiencies are multiplying...

 

 

When I run a profiler and see a giant function sucking down microseconds, I love it. Easiest fix ever.

 

When I run a profiler and see a small function being called many thousand times, I enjoy it. I can isolate it, do some search-and-replace, and call the job done.

 

When I run a profiler and see a common pattern is being wasteful, I can figure out a fix, email the team to watch for it, hunt down bad offenders, and spend a few days trying to clean up.

 

When I run a profiler and see nothing that stands out, but there are thousands of tiny inefficiencies that each require individual assessment, I start having nightmares and consider following a career advancement opportunity elsewhere.


#1frob

Posted 19 February 2014 - 12:39 PM

I imagine things are different for 3D graphically intensive AAA games... but for my 2D indie game, I can always optimize one function, or write a specialized function, when needed.

 

That is the great difficulty about optimization.

 

The closest common expression is "death by a thousand cuts".

 

It isn't the individual slowness that is the problem. 

 

Using a function to calculate it instead of a bit of direct code to calculate. That's fine, it adds a few nanoseconds, but understandable for clarity...

Using accessor functions rather than reading the element directly. That's also fine, it adds a few nanoseconds, but understandable for reuse...

Using virtual functions to allow classes to be customized. Sure it has a cost of a few nanoseconds, but if every subclass must follow different behavior it can be cheaper than the comparisons involved on a piecemeal solution...

Using a function to combine the funcationality to a single place. That's fine, it adds a few nanoseconds, but understandable for readability...

Putting all that in a loop. That's fine, we need to loop, it is understandable because there are more than one...

Copying the pattern into several systems. Well, okay... the individual costs are small but are starting to be significant.

 

 

When I run a profiler and see a giant function sucking down microseconds, I love it. Easiest fix ever.

 

When I run a profiler and see a small function being called many thousand times, I enjoy it. I can isolate it, do some search-and-replace, and call the job done.

 

When I run a profiler and see nothing that stands out, but there are thousands of tiny inefficiencies that each require individual assessment, I start having nightmares.


PARTNERS