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
110
S
28
G
280
Posts: 4,487
Reputation: 156,566

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
402
S
238
G
89
Posts: 24,632
Reputation: 196,031


Return to Javascript SDK

Who is online

Users browsing this forum: No registered users and 0 guests