display.newText bad performance

I have used widget tabview in my app

i found my tableview performance (SDK 1093) takes two times than SDK 993

I found display.newText has poorer performance in 1093

it make my app become very slow…and very obvious

i use many newText in my row and it’s going to create more than 100 rows.

so it idel for 10 seconds. not bearable.

  print("textstart",system.getTimer()) for i = 1, 1000 do     display.newText( "111111111111111111", 0, 0, native.systemFontBold, 16 )     display.newText( "222222222222222222", 0, 0, native.systemFontBold, 16 )     display.newText( "333333333333333333", 0, 0, native.systemFontBold, 16 )     display.newText( "444444444444444444", 0, 0, native.systemFontBold, 16 )     display.newText( "555555555555555555", 0, 0, native.systemFontBold, 16 ) end print("textend",system.getTimer())   -- build 1073 -- textstart    78.755     -- textend    8410.159       -- textstart    87.94     -- textend    8685.673     ------------------------------------------ -- build 993 --textstart    79.937     -- textend    7414.591       --textstart    65.281     -- textend    7233.93    

Hi Owen,

Did you try localizing the “native.systemFontBold” inside the loop, or even outside it?

[lua]

local sfb = native.systemFontBold

display.newText( “222222222222222222”, 0, 0, sfb, 16 )

[/lua]

Also, your test isn’t “realistic”, since you’re generating 5000 text display objects. That’s more than enough to cripple any app, not to mention being a nightmare to manage/organize. I know this is just a test, but since the time numbers you’re showing are based on a non-real-world use case, perhaps some numbers that are more realistic would help show the difference.

Sincerely,

Brent Sorrentino

@Brent

thanks i will give it a try!!

It doesn’t help very much

in my realistic app.

I have 9 newText ,7 newImageRect and 1 newRect in “ONE” row (see pic)

it’s takes around 2 seconds in build 993

more than 8 seconds in build 1093

so i can’t build my app with this latest SDK

going to be killed by users cause the poor performance.

You should try to put something into row and try it’s performance.

Perhaps new widget’s newtableview has poorer performance as well.

I wanna reproduce my situation so i use lots of newText for testing.

In FACT, it 's much slower than my sample test code.

Hi OwenYang,

Just as a remark to the newText:

print("textstart",system.getTimer()) for i = 1, 1000 do local t = display.newText( i \* 1000000000000000, 0, 0, native.systemFontBold, 16 ) local t2 = display.newText( i \* 2000000000000000, 0, 0, native.systemFontBold, 16 ) local t3 = display.newText( i \* 3000000000000000, 0, 0, native.systemFontBold, 16 ) local t4 = display.newText( i \* 4000000000000000, 0, 0, native.systemFontBold, 16 ) local t5 = display.newText( i \* 5000000000000000, 0, 0, native.systemFontBold, 16 ) end print("textend",system.getTimer())

i get

textstart    51.117
textend    2675.868

on 1093.

For the tableview, please post a bug report, and we’ll look at it immediately.

Thanks,

Alex

I also suffered from poor newText performance and I was creating and destroying many text objects over time in my app.  In the end, I reused text objects but only updated their “.text” property as well as their position.  This improved performance quite a bit although it was still a bit slow, especially on Android where the text rendering time seems very long.  I haven’t tried it with build 1093.

@alexf

I have reported one bug

and one bug sample attached.

this sample can reproduced this bug exactly.

Please check it! thanks

it’s one critical bug.  makes app much slower than usual.

report case ->(Case 22975)

@OwenYang: received the bug report,  we’ll be looking into it ASAP.

A great day,

Alex

Hi Owen,

Did you try localizing the “native.systemFontBold” inside the loop, or even outside it?

[lua]

local sfb = native.systemFontBold

display.newText( “222222222222222222”, 0, 0, sfb, 16 )

[/lua]

Also, your test isn’t “realistic”, since you’re generating 5000 text display objects. That’s more than enough to cripple any app, not to mention being a nightmare to manage/organize. I know this is just a test, but since the time numbers you’re showing are based on a non-real-world use case, perhaps some numbers that are more realistic would help show the difference.

Sincerely,

Brent Sorrentino

@Brent

thanks i will give it a try!!

It doesn’t help very much

in my realistic app.

I have 9 newText ,7 newImageRect and 1 newRect in “ONE” row (see pic)

it’s takes around 2 seconds in build 993

more than 8 seconds in build 1093

so i can’t build my app with this latest SDK

going to be killed by users cause the poor performance.

You should try to put something into row and try it’s performance.

Perhaps new widget’s newtableview has poorer performance as well.

I wanna reproduce my situation so i use lots of newText for testing.

In FACT, it 's much slower than my sample test code.

Hi OwenYang,

Just as a remark to the newText:

print("textstart",system.getTimer()) for i = 1, 1000 do local t = display.newText( i \* 1000000000000000, 0, 0, native.systemFontBold, 16 ) local t2 = display.newText( i \* 2000000000000000, 0, 0, native.systemFontBold, 16 ) local t3 = display.newText( i \* 3000000000000000, 0, 0, native.systemFontBold, 16 ) local t4 = display.newText( i \* 4000000000000000, 0, 0, native.systemFontBold, 16 ) local t5 = display.newText( i \* 5000000000000000, 0, 0, native.systemFontBold, 16 ) end print("textend",system.getTimer())

i get

textstart    51.117
textend    2675.868

on 1093.

For the tableview, please post a bug report, and we’ll look at it immediately.

Thanks,

Alex

I also suffered from poor newText performance and I was creating and destroying many text objects over time in my app.  In the end, I reused text objects but only updated their “.text” property as well as their position.  This improved performance quite a bit although it was still a bit slow, especially on Android where the text rendering time seems very long.  I haven’t tried it with build 1093.

@alexf

I have reported one bug

and one bug sample attached.

this sample can reproduced this bug exactly.

Please check it! thanks

it’s one critical bug.  makes app much slower than usual.

report case ->(Case 22975)

@OwenYang: received the bug report,  we’ll be looking into it ASAP.

A great day,

Alex

same her… isnt it possible to speed up the nextext??

Hi @guruk,

I’m not aware of any show-stopping performance issues with display.newText(), so you’ll need to explain how you’re using it, and when (in the process of your Runtime), which exhibits the issues.

Thanks,

Brent

i will try to do some more tests with different corona sdks…

for now its just simple that i test my calendar on my old app zapping from month to month

and with the new corona sdk its around 25% slower. as i did last year some tests already with newText()

i just can think about its the same issue…

anyhow… will do some more tests and if i can share a clear reproducable result i will let u know for sure

greets

chris

same her… isnt it possible to speed up the nextext??

Hi @guruk,

I’m not aware of any show-stopping performance issues with display.newText(), so you’ll need to explain how you’re using it, and when (in the process of your Runtime), which exhibits the issues.

Thanks,

Brent