René's URL Explorer Experiment


Title: Instantiate a custom amount of objects on startup to save even more performance by alfredbaudisch · Pull Request #1 · UnityPatterns/ObjectPool · GitHub

Open Graph Title: Instantiate a custom amount of objects on startup to save even more performance by alfredbaudisch · Pull Request #1 · UnityPatterns/ObjectPool

X Title: Instantiate a custom amount of objects on startup to save even more performance by alfredbaudisch · Pull Request #1 · UnityPatterns/ObjectPool

Description: With the actual code, if you have a fire rate that allows you to shoot let's say 100 bullets at a time, it will instantiate 100 game objects at runtime for the first shoots. Now if you have different pools running at once like bullets, explosions, coins, power ups, etc (like I have in my game, 7 pools) think about instantiating all these objects when the game is running the first time we need the objects, there is a noticeable frame rate and performance drop during the gameplay, specially in fast paced games. For that reason I improved the class to allow the pre-instantiation of a defined amount of objects at startup. For the Turrent demo, on startup 10 bullets and 10 explosions are added to the pool and recycled before we even need them, this way when we shoot, the pool will never create another object, since 10 is more than enough to the demo's fire rate. The magic is in the new CreatePool(T prefab, int initialAmount) and RecycleAll(T obj) methods. EDITED: CreatePool(T prefab, int initialAmount) now uses SpawnInactive instead of Spawn + RecycleAll.

Open Graph Description: With the actual code, if you have a fire rate that allows you to shoot let's say 100 bullets at a time, it will instantiate 100 game objects at runtime for the first shoots. Now if you have dif...

X Description: With the actual code, if you have a fire rate that allows you to shoot let's say 100 bullets at a time, it will instantiate 100 game objects at runtime for the first shoots. Now if you have...

Opengraph URL: https://github.com/UnityPatterns/ObjectPool/pull/1

X: @github

direct link

Domain: patch-diff.githubusercontent.com

route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:80b94897-f189-a6e5-aec7-e0971932ad31
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idB058:2D44FC:1134C9D:166F393:6982AFF5
html-safe-nonce3c55acad81055b4730340de18585b41973714602ceb5a743a6cbb32429585e61
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMDU4OjJENDRGQzoxMTM0QzlEOjE2NkYzOTM6Njk4MkFGRjUiLCJ2aXNpdG9yX2lkIjoiODAxOTEyMDEzNDMyMzA4OTM5NyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac3edad8f3d8f281272f2d62bf2458bd64fe93d6aa92d8a4ef329349bb997fe7f6
hovercard-subject-tagpull_request:9821162
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/UnityPatterns/ObjectPool/pull/1/files
twitter:imagehttps://avatars.githubusercontent.com/u/248383?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/248383?s=400&v=4
og:image:altWith the actual code, if you have a fire rate that allows you to shoot let's say 100 bullets at a time, it will instantiate 100 game objects at runtime for the first shoots. Now if you have dif...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Nonec6741528aa4d4ba81c57bbff8f8cc0de0e9115cb2993431dc9dac8d489f7b4ee
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/UnityPatterns/ObjectPool git https://github.com/UnityPatterns/ObjectPool.git
octolytics-dimension-user_id5545416
octolytics-dimension-user_loginUnityPatterns
octolytics-dimension-repository_id13115287
octolytics-dimension-repository_nwoUnityPatterns/ObjectPool
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id13115287
octolytics-dimension-repository_network_root_nwoUnityPatterns/ObjectPool
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releasec547e382acfeb1148025e943f9b5dc5a5e306b0e
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://patch-diff.githubusercontent.com/UnityPatterns/ObjectPool/pull/1/changes#start-of-content
https://patch-diff.githubusercontent.com/
Sign in https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2FUnityPatterns%2FObjectPool%2Fpull%2F1%2Ffiles
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2FUnityPatterns%2FObjectPool%2Fpull%2F1%2Ffiles
Sign up https://patch-diff.githubusercontent.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=UnityPatterns%2FObjectPool
Reloadhttps://patch-diff.githubusercontent.com/UnityPatterns/ObjectPool/pull/1/changes
Reloadhttps://patch-diff.githubusercontent.com/UnityPatterns/ObjectPool/pull/1/changes
Reloadhttps://patch-diff.githubusercontent.com/UnityPatterns/ObjectPool/pull/1/changes
UnityPatterns https://patch-diff.githubusercontent.com/UnityPatterns
ObjectPoolhttps://patch-diff.githubusercontent.com/UnityPatterns/ObjectPool
Notifications https://patch-diff.githubusercontent.com/login?return_to=%2FUnityPatterns%2FObjectPool
Fork 94 https://patch-diff.githubusercontent.com/login?return_to=%2FUnityPatterns%2FObjectPool
Star 423 https://patch-diff.githubusercontent.com/login?return_to=%2FUnityPatterns%2FObjectPool
Code https://patch-diff.githubusercontent.com/UnityPatterns/ObjectPool
Issues 1 https://patch-diff.githubusercontent.com/UnityPatterns/ObjectPool/issues
Pull requests 4 https://patch-diff.githubusercontent.com/UnityPatterns/ObjectPool/pulls
Actions https://patch-diff.githubusercontent.com/UnityPatterns/ObjectPool/actions
Projects 0 https://patch-diff.githubusercontent.com/UnityPatterns/ObjectPool/projects
Wiki https://patch-diff.githubusercontent.com/UnityPatterns/ObjectPool/wiki
Security 0 https://patch-diff.githubusercontent.com/UnityPatterns/ObjectPool/security
Insights https://patch-diff.githubusercontent.com/UnityPatterns/ObjectPool/pulse
Code https://patch-diff.githubusercontent.com/UnityPatterns/ObjectPool
Issues https://patch-diff.githubusercontent.com/UnityPatterns/ObjectPool/issues
Pull requests https://patch-diff.githubusercontent.com/UnityPatterns/ObjectPool/pulls
Actions https://patch-diff.githubusercontent.com/UnityPatterns/ObjectPool/actions
Projects https://patch-diff.githubusercontent.com/UnityPatterns/ObjectPool/projects
Wiki https://patch-diff.githubusercontent.com/UnityPatterns/ObjectPool/wiki
Security https://patch-diff.githubusercontent.com/UnityPatterns/ObjectPool/security
Insights https://patch-diff.githubusercontent.com/UnityPatterns/ObjectPool/pulse
Sign up for GitHub https://patch-diff.githubusercontent.com/signup?return_to=%2FUnityPatterns%2FObjectPool%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://patch-diff.githubusercontent.com/login?return_to=%2FUnityPatterns%2FObjectPool%2Fissues%2Fnew%2Fchoose
alfredbaudischhttps://patch-diff.githubusercontent.com/alfredbaudisch
UnityPatterns:masterhttps://patch-diff.githubusercontent.com/UnityPatterns/ObjectPool/tree/master
alfredbaudisch:masterhttps://patch-diff.githubusercontent.com/alfredbaudisch/ObjectPool/tree/master
Conversation 1 https://patch-diff.githubusercontent.com/UnityPatterns/ObjectPool/pull/1
Commits 4 https://patch-diff.githubusercontent.com/UnityPatterns/ObjectPool/pull/1/commits
Checks 0 https://patch-diff.githubusercontent.com/UnityPatterns/ObjectPool/pull/1/checks
Files changed https://patch-diff.githubusercontent.com/UnityPatterns/ObjectPool/pull/1/files
Please reload this pagehttps://patch-diff.githubusercontent.com/UnityPatterns/ObjectPool/pull/1/changes
Instantiate a custom amount of objects on startup to save even more performance https://patch-diff.githubusercontent.com/UnityPatterns/ObjectPool/pull/1/changes#top
Show all changes 4 commits https://patch-diff.githubusercontent.com/UnityPatterns/ObjectPool/pull/1/files
7bac544 Instantiate a custom amount of objects on startup alfredbaudisch Nov 9, 2013 https://patch-diff.githubusercontent.com/UnityPatterns/ObjectPool/pull/1/commits/7bac54441e2c602245d267e3a299d750cca775b8
f21d05f Create the pools with 10 instatiated bullets and explosions alfredbaudisch Nov 9, 2013 https://patch-diff.githubusercontent.com/UnityPatterns/ObjectPool/pull/1/commits/f21d05f59fbf289616153e2cdafaf516fb9183b6
8dfd186 GetAllOfType returns all inactive instances of prefab T alfredbaudisch Nov 11, 2013 https://patch-diff.githubusercontent.com/UnityPatterns/ObjectPool/pull/1/commits/8dfd186fae13f4bd95c849350357f76858d77863
ef54b60 SpawnInactive is used instead of Spawn and RecycleAll when creating p… alfredbaudisch Nov 11, 2013 https://patch-diff.githubusercontent.com/UnityPatterns/ObjectPool/pull/1/commits/ef54b60eecbe0d7c2d9c6f8dd4b54f6e07aae85e
Clear filters https://patch-diff.githubusercontent.com/UnityPatterns/ObjectPool/pull/1/files
Please reload this pagehttps://patch-diff.githubusercontent.com/UnityPatterns/ObjectPool/pull/1/changes
Please reload this pagehttps://patch-diff.githubusercontent.com/UnityPatterns/ObjectPool/pull/1/changes
Turret.cs https://patch-diff.githubusercontent.com/UnityPatterns/ObjectPool/pull/1/changes#diff-7c6aa9043eef415e3efbd90235a705f8d24f28f0e0a2eebc7255d847714ee7f8
ObjectPool.cs https://patch-diff.githubusercontent.com/UnityPatterns/ObjectPool/pull/1/changes#diff-4201597ecf1f6de1b6888e2b386feca273c07a58099848052761e8c9024ddcc2
Assets/ObjectPool/Demo/Scripts/Turret.cshttps://patch-diff.githubusercontent.com/UnityPatterns/ObjectPool/pull/1/changes#diff-7c6aa9043eef415e3efbd90235a705f8d24f28f0e0a2eebc7255d847714ee7f8
View file https://patch-diff.githubusercontent.com/UnityPatterns/ObjectPool/blob/ef54b60eecbe0d7c2d9c6f8dd4b54f6e07aae85e/Assets/ObjectPool/Demo/Scripts/Turret.cs
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://patch-diff.githubusercontent.com/UnityPatterns/ObjectPool/pull/1/{{ revealButtonHref }}
https://patch-diff.githubusercontent.com/UnityPatterns/ObjectPool/pull/1/changes#diff-7c6aa9043eef415e3efbd90235a705f8d24f28f0e0a2eebc7255d847714ee7f8
https://patch-diff.githubusercontent.com/UnityPatterns/ObjectPool/pull/1/changes#diff-7c6aa9043eef415e3efbd90235a705f8d24f28f0e0a2eebc7255d847714ee7f8
Assets/ObjectPool/Scripts/ObjectPool.cshttps://patch-diff.githubusercontent.com/UnityPatterns/ObjectPool/pull/1/changes#diff-4201597ecf1f6de1b6888e2b386feca273c07a58099848052761e8c9024ddcc2
View file https://patch-diff.githubusercontent.com/UnityPatterns/ObjectPool/blob/ef54b60eecbe0d7c2d9c6f8dd4b54f6e07aae85e/Assets/ObjectPool/Scripts/ObjectPool.cs
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://patch-diff.githubusercontent.com/UnityPatterns/ObjectPool/pull/1/{{ revealButtonHref }}
https://patch-diff.githubusercontent.com/UnityPatterns/ObjectPool/pull/1/changes#diff-4201597ecf1f6de1b6888e2b386feca273c07a58099848052761e8c9024ddcc2
https://patch-diff.githubusercontent.com/UnityPatterns/ObjectPool/pull/1/changes#diff-4201597ecf1f6de1b6888e2b386feca273c07a58099848052761e8c9024ddcc2
https://patch-diff.githubusercontent.com/UnityPatterns/ObjectPool/pull/1/changes#diff-4201597ecf1f6de1b6888e2b386feca273c07a58099848052761e8c9024ddcc2
https://patch-diff.githubusercontent.com/UnityPatterns/ObjectPool/pull/1/changes#diff-4201597ecf1f6de1b6888e2b386feca273c07a58099848052761e8c9024ddcc2
https://patch-diff.githubusercontent.com/UnityPatterns/ObjectPool/pull/1/changes#diff-4201597ecf1f6de1b6888e2b386feca273c07a58099848052761e8c9024ddcc2
https://patch-diff.githubusercontent.com/UnityPatterns/ObjectPool/pull/1/changes#diff-4201597ecf1f6de1b6888e2b386feca273c07a58099848052761e8c9024ddcc2
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.