Re: [c-prog] How OOP affect performance

2008-12-09 Thread Pedro Izecksohn
--- Jos Timanta Tarigan asked:

 i want those vertices become objects in triangles.

  Interesting new concept :)

 here is my question: is calling vertices[i].move() will take less time than 
 calling triangle[i].vertices[k].move() ? well i know it will but is it that 
 significant?

  I never saw any conscious vertex that know how it should move ;)

  Every indirection takes time. How much time is that significant?

  How much time each indirection take? It depends on if the content of 
triangle[i] is cached or not.

  Are you paulista?


Re: [c-prog] How OOP affect performance

2008-12-08 Thread Pedro Izecksohn
--- Jos Timanta Tarigan asked:
 
 im currently trying to convert a code from functional to OOP. but the program 
 is 
 performance sensitive kind of program. is it that significant to change from 
 functional to OOP? how it will affect the programs performance(time and 
 memory)? 
 is it that much different from calling a function compared to a function from 
 another object?

  Does functional here means procedural?

  The answer to this question is language dependent: Are you planning
to do OOP using plain C? Or do you plan to use C++ or Java?

  Write a little performance tester and measure it yourself.