Errors, bugs, questions - page 2873

 


EX5 loading failed
 

Critical error during execution

struct pack(8) A {
typedef void (*fn)();
        fn f;
};
void OnStart() {}

Result: EX5 loading failed

 
A100:

Does the alignment of structures affect the speed of execution?

 
fxsaber:

Does alignment of structures affect execution speed?

It does in some cases, here is a quote:"In most cases you do not need to worry about alignment as the default alignment is already optimal.But in some cases a significant performance improvement or memory saving can be achieved by specifying a custom alignment for data structures".

 
A100:

It does in some cases, here's a quote:"In most cases you don't need to worry about alignment as the default alignment is already optimal.However, in some cases you can achieve significant performance improvements or memory savings by specifying a custom alignment for data structures."

Just one example of this.

 
fxsaber:

At least one example of such.

I have alignment because of necessity - quote from documentation:"Alignment of structure fields may be needed when exchanging data with third-party libraries (*.DLL), in which such alignment is applied".

Try to gauge all pack values and compare the speed

 
A100:

Try gambling through all the pack values and compare speeds.

We need to decide which code to measure.

If I understand correctly, class alignment is not provided. I.e. it's quite possible that when working with an array of class objects (not pointers), it may be reasonable to replace class fields with an aligned structure.

Anyway, I'm not on the topic.

 
fxsaber:

If I understand correctly, class alignment is not provided. I.e. it's possible that when working with an array of class objects (not pointers), it may be reasonable to replace class fields with an aligned structure.

Now I've tried the pack classes - the size changes

 

A question about buying a library (not an advisor) from Market.

I want to use the library in my research. Accordingly, it should work on any accounts and terminals.

Is this possible for Market libraries?

 
fxsaber:

At least one example of this.

I doubt that many people use data optimization nowadays, at most game developers, but even there everyone has their own ready-made game engines which are already optimized

searched around, imho if there are any specific recommendations, i would search herehttps://www.ibm.com/support/knowledgecenter/ru/

tried to search, but it did not work - there are many variants of queries, here is closer to the subjecthttps://www.ibm.com/support/knowledgecenter/ru/ssw_aix_72/performance/cache_tlbs.html

I searched for "structure pack" and "structure performance".



if you check, it must be a pod-structure and you have to write it as distorted as possible, i.e. you take all data types (long, int, short, char,double,float) and create 15 fields and mix up the fields by data types, so you can align these fields with pack directive at least on the boundary of the computer word

You may also try to copy structures, pass them as parameters to functions and change the fields' contents


but, imho, you will have a palpable difference if the total size of such data (array of structures) is at least a couple of megabytes to fill up the processor cache as much as possible

Reason: