performance - Working with many Javascript functions -


I am currently working with a personal library which is accumulating a lot of "helpful" tasks, Which is used in my architecture for a variety of purposes only when there were only a few of them, then I put them in a file and could do them as an object:

  Tools. Parseseming (oboes);   

It has been very easy, and keeps the code somewhat systematic and readable. The problem is that the file (and object) with these methods is increasing at a large size, and requires cleaning, I was considering creating separate files for the "categories" of the function and putting them on them , So they will be transported like this:

  tools.env.getEnvironmentInfo ();   

My concern with this approach is not too much readability, but the look of the look-up The objects that I've read recently, the object look-up is no longer the major bottle neck, but I still want my library as much as possible (readability).

I also consider separate files, but add all functions to the original object so they can still reach the original way, but stored separately. The object with the function is "static" and exists as an example.

My question is, in relation to what I have explained, using one of the most effective methods of storage and the use of large quantities, I mean the performance of the helpers, which is the only concern for me at this time. Is the area.

Agree that premature adaptation is going on here, although this was not your question.

I say that instead of thinking about loose articles related to 'related things', D suggests a rich object model which can be stateful and possibly hide such optimization For those who need to hide some optimizations, such as caching lookups, etc.

Why getEnvironmentInfo is not a environment example, for example, already obtained some parameters and stored internally So that the subsequent calls will be made faster, from there you can create new environments or whatever other behaviors you are comfortable with.

This is the best programming practice in any language.

Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -