Suggestion: a global hash cache

For developers using the Construct 2 Javascript SDK

Post » Thu Oct 24, 2013 8:34 am

There is a "lineCache" in official text plugin, which provided alloc/free method to decrease the GC of hash table.
My suggestion is , the engine (cr) might provide a global "lineCache" (a single, global "hash table cache") for any plugin which need alloc/free hash table frequently.rexrainbow2013-10-24 08:36:10
B
108
S
26
G
272
Posts: 4,471
Reputation: 152,277

Post » Thu Oct 24, 2013 10:56 am

Javascript engines perform best when objects have a consistent shape (i.e. the same properties). If we shared objects between unrelated plugins which used different shape objects, that could actually reduce performance. It seems better to make a separate recycling cache for each shape of object, since you get both GC recycling and high performance. Still, perhaps we could have written a library to make this easier...
Scirra Founder
B
398
S
236
G
88
Posts: 24,428
Reputation: 194,600


Return to Javascript SDK

Who is online

Users browsing this forum: No registered users and 0 guests