on 19-07-2012 04:58 PM
on 19-07-2012 05:06 PM
I profiled (if this is what its called) the main method for "loading" an image (create) and this is what I came up with:
public void create(GameHandler gh,float scale)
{
Sce.Pss.HighLevel.GameEngine2D.Base.Timer t = new Sce.Pss.HighLevel.GameEngine2D.Base.Timer();
t.Reset();
Console.WriteLine(t.Milliseconds().ToString());
TextureInfo ti = new TextureInfo(new Texture2D(filename,false));
Console.WriteLine(t.Milliseconds().ToString());
index = gh.newsprite(ti,position,scale);
Console.WriteLine(t.Milliseconds().ToString());
}
And here are some resulting timer data-sets (With all black 1000x1000 blocks):
Playstation Suite Simulator:
0.0008
35.7639
35.8201
0.0017
37.869
37.9349
0.0008
36.4676
36.5237
0.0013
36.1609
36.2367
On my Vita:
2.047
188.731
215.77
00.003
180.607
180.997
10.002
174.982
175.347
20.001
176.699
177.089
________________________________
Also interesting to see is that the vita seems to load much slower than the Simulator. And now i know that it is not the fault of my "GameHandler"
weeew. But well.. how to continue?
on 19-07-2012 05:10 PM
Hi:
Excellent !! ,now let me ask which call it's this one:
0.0017
37.869
37.9349
?
cheers
on 19-07-2012 05:19 PM
@noggsy:
sounds quite of allright, i'll try this later on.
@AlexMcDev:
what do you mean with "which call it's this one" it was the secund test load of a 1000x1000px whole black png file using the code i got above with the "Playstation Suite Simulator".
on 19-07-2012 06:45 PM
Hi:
Ok. now I have a better understanding, good you have this difference between your nesrpite call:
0.0659
0.0562
0.0758
thats good, but between the TExtureInfo and your call it's to much!!, since that texture info seems to be equal for the three big texture try to call it outside the thread. Only in the initialization of everything you have and then share it. try like this. Because there probably it's doing a context switch/ HW interrup.
Cheers,
PS: if not clear let me know.
on 19-07-2012 06:52 PM
Hi:
To clarify (soory I'm at work right now I'm not paying attention) new Texture() if unavoidable so that time it's imposible to change but change it to TextureInfo(filename), Anyways I think that part you will not have another solution than left it. U don't have the TextureInfoCode, well thats not 100% true. Another thing check next thing, Remove Texture info and left only the Texture2D to see if you have some ms gain.
cheers,
on 19-07-2012 07:46 PM
I am trying to follow noggsy's suggestion on how to solve my problem:
This is what I came up with:
byte[] bytearray;
private void loadbytearray()
{
System.IO.FileStream fs = System.IO.File.Open(filename,System.IO.FileMode.Op en);
byte[] b = new byte[fs.Length];
fs.Read(b,0,b.Length);
fs.Close();
Sce.Pss.Core.Imaging.Image image = new Sce.Pss.Core.Imaging.Image(b);
image.Decode();
bytearray = image.ToBuffer();
loaded = true;
image.Dispose();
image = null;
}
private Texture2D bytearraytotexture2d()
{
Texture2D texture = new Texture2D(1000,1000,false,PixelFormat.Rgba);
texture.SetPixels(0,bytearray);
bytearray = null;
return texture;
}
public void create(GameHandler gh,float scale)
{
Sce.Pss.HighLevel.GameEngine2D.Base.Timer t = new Sce.Pss.HighLevel.GameEngine2D.Base.Timer();
t.Reset();
Console.WriteLine(t.Milliseconds().ToString());
loadbytearray();
Console.WriteLine(t.Milliseconds().ToString());
draw(gh);
Console.WriteLine(t.Milliseconds().ToString());
}
public void draw(GameHandler gh)
{
index = gh.newsprite(new TextureInfo(bytearraytotexture2d()),position,1f);
} Calling "create" does now load textures in a "complete diffrerent" way than before and im really happy with the timer results, but look at them on your own:
(This time just on one device because im too lazy haha)
Playstation Suite Simulator:
0.0008
70.8607
75.6543
0.0009
74.1187
78.9819
0.0008
48.902
53.6447
0.0012
64.6147
69.1027
____________________________
The total difference is that this method is way faster and i know that i can handle "loadbytearray" in another thread - resulting would be a ingame lag about 2-3 millisecunds for loading 1000x1000px whole black images. But I got problems with handling this in a secund thread, any suggestions?
on 19-07-2012 07:47 PM
ignore that "loaded = true" in loadbytearray(). I forgot to delete that line after i failed at trying to handle multi-threading.
on 19-07-2012 07:54 PM
Hi:
XD, good, but let me ask something, you are happy because yoir first implementation it's better than this one right?
Cheers,
PS: The time it's worts in the last.
on 19-07-2012 08:11 PM
No im happy because my first one wasnt handleable in an other thread than the main thread and this one is ![]()
But.. without extra threading, while workling on my pc, the Psapp suddenly broke. I put some control System.Console.Writeline() stuff inside my code and I finally saw that my app breaks at Frame 6501 on Sce.Pss.HighLevel.GameEngine2D.Director.Instance.
PSM Developer Registration (for free) on PSM DevPortal is required to post on the forum.
Please sign out then sign in again to the forum and PSM DevPortal after you have completed the registration.
フォーラムへ投稿をするにはPSM DevPortalへの登録(無料)が必要です。
登録後はフォーラムと
PSM DevPortalを一度ログアウトし、再度ログインしてください。


Website ©2013 Sony Computer Entertainment Europe
All content, game titles, trade names and/or trade dress, trademarks, artwork and associated imagery are trademarks and/or copyright material of their respective owners. All rights reserved. [more info]
%%http://community.eu.playstation.com/t5/Announcements/Beta-Trial-Information/td-p/11386362
best_shooter.png%%http://community.eu.playstation.com/t5/Announcements/Introducing-Best-of-PlayStation/td-p/13741979
best_driver.png%%http://community.eu.playstation.com/t5/Announcements/Introducing-Best-of-PlayStation/td-p/13741979
best_performer.png%%http://community.eu.playstation.com/t5/Announcements/Introducing-Best-of-PlayStation/td-p/13741979
best_footballer.png%%http://community.eu.playstation.com/t5/Announcements/Introducing-Best-of-PlayStation/td-p/13741979
best_fighter.png%%http://community.eu.playstation.com/t5/Announcements/Introducing-Best-of-PlayStation/td-p/13741979
best_creator.png%%http://community.eu.playstation.com/t5/Announcements/Introducing-Best-of-PlayStation/td-p/13741979
best_action_player.png%%http://community.eu.playstation.com/t5/Announcements/Introducing-Best-of-PlayStation/td-p/13741979
dev2.png%%http://community.eu.playstation.com/t5/Website-and-Forum-Help-Feedback/Producer-and-Developer-Ranks/td-p/18407352
trophy.gif%%http://community.eu.playstation.com/t5/Website-and-Forum-Help-Feedback/The-Community-Awards-FAQ/td-p/18407096
PSlogoSM.png%%http://community.eu.playstation.com/t5/Website-and-Forum-Help-Feedback/Online-Support-Coordinator-rank/td-p/18414870