Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

GBC Object Pool - Now in the Marketplace!
Started by schizoid2k Feb 04 2017 07:05 AM

11 replies to this topic
[TOPIC CONTROLS]
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

schizoid2k

[GLOBAL: userInfoPane.html]
schizoid2k
  • Contributor

  • 516 posts
  • Corona SDK

My latest plugin, GBC Object Pool, is now in the marketplace.

 

The GBC Object Pool plugin allows the CoronaSDK developer to easily and quickly implement object pooling within your application. Using two lines of code, you can create an object pool. GBC Object Pool optimizes the management of pooling, allowing for object reuse and eliminates garbage collection inherently found with traditional create/destroy functions.

 

The plugin provides several examples of pooling.  If there are any questions or requests, please let me know. I plan on writing more examples, blogs, and perhaps some videos on the  use of this plugin.

 

Some links:

 

GBC Object Pool in the Corona Marketplace

Link to documentation

Link to example code

 

Thanks,

--John



[TOPIC: post.html]
#2

schizoid2k

[GLOBAL: userInfoPane.html]
schizoid2k
  • Contributor

  • 516 posts
  • Corona SDK

I recently ran some metrics.

 

--john



[TOPIC: post.html]
#3

schizoid2k

[GLOBAL: userInfoPane.html]
schizoid2k
  • Contributor

  • 516 posts
  • Corona SDK

Update pushed to Marketplace.

More examples added.

Additional articles written.

If there is any interest in videos, please let me know.



[TOPIC: post.html]
#4

schizoid2k

[GLOBAL: userInfoPane.html]
schizoid2k
  • Contributor

  • 516 posts
  • Corona SDK

Version 1.2 added

-- Fixes error when using autoexpand feature



[TOPIC: post.html]
#5

nick_sherman

[GLOBAL: userInfoPane.html]
nick_sherman
  • Corona Geek

  • 1,190 posts
  • Corona SDK

Thanks John. I'm hoping this will along with other changes improve the responsiveness of my game on slower windows machines, particularly those with IDE drives.



[TOPIC: post.html]
#6

sporkfin

[GLOBAL: userInfoPane.html]
sporkfin
  • Contributor

  • 189 posts
  • Corona SDK

Hey John,

 

Are the performance bonuses less obvious on mac and iOS because slowest apple devices maintain a level of processing and graphics power much higher than low-end Windows and Android devices?

 

I would be interested in seeing a video for sure.  No rush, I purchased the plugin but I probably won't implement it for while.



[TOPIC: post.html]
#7

schizoid2k

[GLOBAL: userInfoPane.html]
schizoid2k
  • Contributor

  • 516 posts
  • Corona SDK

Hey John,

 

Are the performance bonuses less obvious on mac and iOS because slowest apple devices maintain a level of processing and graphics power much higher than low-end Windows and Android devices?

 

I would be interested in seeing a video for sure.  No rush, I purchased the plugin but I probably won't implement it for while.

 

Hi, and thanks for your purchase Sharp100... I appreciate it.

 

I ran some performance metrics on Windows and Android and I blog about it here.  I can also give it a try on iOS and OSX, and I can publish those results.  As for videos, I can give that a shot as well... I've been thinking about it a bit.  :)

 

The results in the test I performed show that object pooling in general (and the GBC Object Pool plugin to be specific) is faster than the typical create/destroy methods used without pooling.  Pooling eliminates the overhead of allocating memory and garbage collection during the create/destroy cycle.  You can see that pooling results in more consistent performance as well.  The wide dispersion on times using create/destroy as shown in the charts may cause an issue when a user is playing your game... they might notice stutters or delays.

 

I have a sample app with source code that shows object pooling in action (located here), and it's free to download.  The first scene is a performance test, and you will see that the type of object you want to pool will impact performance.  For example, creating/destroying a simple white square shape will probably not show significant performance gains using pooling (in other words, Corona is pretty good at doing that).  

 

Where pooling (and my plugin) really improves performance is in creating pools of images, optional physics properties, and/or complex objects.

 

Hope this helps.  If anyone has questions, please let me know.

 

--John



[TOPIC: post.html]
#8

sporkfin

[GLOBAL: userInfoPane.html]
sporkfin
  • Contributor

  • 189 posts
  • Corona SDK

Yes, that's very helpful and I have an app with lots of physics bodies that lags on Android devices.  This should definitely help!  Your language cabinet looks cool too.  I look forward to trying that plugin as well.

 

-Jonathan



[TOPIC: post.html]
#9

nick_sherman

[GLOBAL: userInfoPane.html]
nick_sherman
  • Corona Geek

  • 1,190 posts
  • Corona SDK

John,

 

Don't know if you saw my e-mail yet, having another issue with the autoexpand feature whereby more than the specified number of objects are created, which exponentially increases each time the pool runs dry.

 

Nick



[TOPIC: post.html]
#10

schizoid2k

[GLOBAL: userInfoPane.html]
schizoid2k
  • Contributor

  • 516 posts
  • Corona SDK

Sorry Nick... I will check into this right now.



[TOPIC: post.html]
#11

schizoid2k

[GLOBAL: userInfoPane.html]
schizoid2k
  • Contributor

  • 516 posts
  • Corona SDK

I think we go it this time!  :)

 

Thanks to Nick for helping me track down the issue.  New version on the Marketplace.



[TOPIC: post.html]
#12

schizoid2k

[GLOBAL: userInfoPane.html]
schizoid2k
  • Contributor

  • 516 posts
  • Corona SDK

An update to GBC Object Pool is now in the Marketplace.  This update enables a way to pass a table of parameters to your create and reset functions, which helps reduce the amount of code needed to manage your pools.  You can read about it in more detail here:

 

GBC Object Pool Update - Parameters

Examples and Source Code

 

--john




[topic_controls]
[/topic_controls]