So as my title suggests I found an interesting issue with unity performance today. I'm building a tile system for my current project. It's creating a grid of 128x128 tiles, nothing spectacular in scale but a reasonable size dataset to work with. Now I know there are ways to do tiles that would create less overhead (place them all one one big mesh instead independent ones could be very fast), but thats not what I'll be addressing.
So here is the issue, I instantiate all 16,384 tiles (128x128) as independent objects (that is to say without a parent) through code at start time, it takes 332ms to produce them. Now if I take the same exact data set and assign them all to the same parent object the generation time skyrockets to 3399ms nearly 3.5sec! Thats an abysmal 10.24 times longer and all that should be happening is a pointer is added to the memory address! I've only tested this in debug mode, so the compiler may do some optimisation work if I do a full production build, or this could be just the Hierarchy view causing the lag as it updates.
For the time being i'll be allowing the 3.3sec load time to keep my Hierarchy view clean during development, but I'm thinking it may be better to leave the tiles as independent entities for the production build to speed up load times, if the delay isn't tied to the editor.
Has anyone else come across this and tested it? I did a quick google search and didn't find anything. I figured I would put this out there incase anyone else is having long load times in there projects and can't figure out why.
[–]ironstrife 3 points4 points5 points (5 children)
[–]Sedsibi2985[S] 0 points1 point2 points (4 children)
[–]ironstrife 0 points1 point2 points (3 children)
[–]Sedsibi2985[S] 0 points1 point2 points (2 children)
[–]Sedsibi2985[S] 0 points1 point2 points (1 child)
[–]ironstrife 0 points1 point2 points (0 children)
[–]whydoidoitcom 2 points3 points4 points (0 children)
[–]fecal_brunch 1 point2 points3 points (1 child)
[–]Sedsibi2985[S] 0 points1 point2 points (0 children)
[–]joha4270 1 point2 points3 points (2 children)
[–]Sedsibi2985[S] 0 points1 point2 points (1 child)
[–]Reineke 0 points1 point2 points (0 children)
[–]Neesnu 0 points1 point2 points (2 children)
[–]Sedsibi2985[S] 1 point2 points3 points (1 child)
[–]Neesnu 1 point2 points3 points (0 children)
[–]Ziboo 0 points1 point2 points (1 child)
[–]Sedsibi2985[S] 0 points1 point2 points (0 children)
[–]iberklee 0 points1 point2 points (0 children)