Author Topic: [Ndless] Help with bottleneck on color calcs only  (Read 17322 times)

0 Members and 1 Guest are viewing this topic.

Offline Matrefeytontias

  • Axe roxxor (kinda)
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1982
  • Rating: +310/-12
  • Axe roxxor
    • View Profile
    • RMV Pixel Engineers
Re: [Ndless] Help with bottleneck on color calcs only
« Reply #15 on: June 27, 2014, 04:27:08 pm »
Alright so that's what to test. It's simply memcpy-ing a buffer to the screen 1000 times.

Offline Streetwalrus

  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3821
  • Rating: +80/-8
    • View Profile
Re: [Ndless] Help with bottleneck on color calcs only
« Reply #16 on: June 27, 2014, 05:08:45 pm »
This executed in about 6.5 seconds for me.

Offline pimathbrainiac

  • Occasionally I make projects
  • Members
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1731
  • Rating: +136/-23
  • dagaem
    • View Profile
Re: [Ndless] Help with bottleneck on color calcs only
« Reply #17 on: June 27, 2014, 05:12:28 pm »
2.5 seconds on the GS CAS calc.
I am Bach.

Offline Streetwalrus

  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3821
  • Rating: +80/-8
    • View Profile
Re: [Ndless] Help with bottleneck on color calcs only
« Reply #18 on: June 27, 2014, 05:13:22 pm »
Holy cow that's quite the difference. O.O So it's got to do with writing to the LCD being slow I guess.

Offline Matrefeytontias

  • Axe roxxor (kinda)
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1982
  • Rating: +310/-12
  • Axe roxxor
    • View Profile
    • RMV Pixel Engineers
Re: [Ndless] Help with bottleneck on color calcs only
« Reply #19 on: June 27, 2014, 05:15:04 pm »
But I never saw anything like that happen before ... There must be something Nspire-related I forgot to setup ... Could TCT_Local_Interrupts(int) be the cause of this ?

Offline Streetwalrus

  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3821
  • Rating: +80/-8
    • View Profile
Re: [Ndless] Help with bottleneck on color calcs only
« Reply #20 on: June 27, 2014, 05:16:05 pm »
Protip : always disable OS crap before doing anything. :P

Offline Vogtinator

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1193
  • Rating: +108/-5
  • Instruction counter
    • View Profile
Re: [Ndless] Help with bottleneck on color calcs only
« Reply #21 on: June 27, 2014, 05:39:53 pm »
I had to disable all IRQs and FIQs to get rid of the clock on screen, but TCT_Local_Control_Interrupts(0) should do the same.
But normally ndless itself does that already.

And matref, are you copying directly to SCREEN_BASE_ADDRESS? On GS calcs it's in SRAM and on CX in sdram because of it's size.

Offline Matrefeytontias

  • Axe roxxor (kinda)
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1982
  • Rating: +310/-12
  • Axe roxxor
    • View Profile
    • RMV Pixel Engineers
Re: [Ndless] Help with bottleneck on color calcs only
« Reply #22 on: June 27, 2014, 05:53:35 pm »
I'm indeed copying to *(void**)0xC0000010. So would allocating a buffer in RAM and using it even on color calcs fix the speed issue ? (hopeless try)

Offline Vogtinator

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1193
  • Rating: +108/-5
  • Instruction counter
    • View Profile
Re: [Ndless] Help with bottleneck on color calcs only
« Reply #23 on: June 27, 2014, 05:55:28 pm »
You shouldn't be able to write to SRAM if you're in 16bpp mode and filling the screen.
SRAM is 0xA4000000 - 0xA4020000 = 128 KiB and 320*240*16b= 150KiB

Offline Matrefeytontias

  • Axe roxxor (kinda)
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1982
  • Rating: +310/-12
  • Axe roxxor
    • View Profile
    • RMV Pixel Engineers
Re: [Ndless] Help with bottleneck on color calcs only
« Reply #24 on: June 27, 2014, 05:58:06 pm »
On monochrome calcs, I malloc two 320*240*2 buffers instead of one, one being an actual buffer and one acting as the screen. On color calcs I only allocate one buffer and use the default screen buffer.

Offline Vogtinator

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1193
  • Rating: +108/-5
  • Instruction counter
    • View Profile
Re: [Ndless] Help with bottleneck on color calcs only
« Reply #25 on: June 27, 2014, 06:02:15 pm »
I'm doing the same thing in nGL, but actually a third buffer, so the screen buffer is still usable after inversion.
So is the GS's SDRAM indeed that much slower?

Offline Matrefeytontias

  • Axe roxxor (kinda)
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1982
  • Rating: +310/-12
  • Axe roxxor
    • View Profile
    • RMV Pixel Engineers
Re: [Ndless] Help with bottleneck on color calcs only
« Reply #26 on: June 27, 2014, 06:03:55 pm »
Well, I don't know but I'll try that, and if that's it I'll call it another thing that we should know.

* Matrefeytontias would be so happy if that was the actual problem

EDIT : wait a minute you misunderstood. The program is 2.5 times faster on GS calcs than on color calcs, not the other way around.

Offline aeTIos

  • Nonbinary computing specialist
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3915
  • Rating: +184/-32
    • View Profile
    • wank.party
Re: [Ndless] Help with bottleneck on color calcs only
« Reply #27 on: June 27, 2014, 06:07:15 pm »
I decided to un-overclock my calc and re-run copyscreen1000times.12:53 seconds.
I'm not a nerd but I pretend:

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55941
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: [Ndless] Help with bottleneck on color calcs only
« Reply #28 on: June 27, 2014, 06:12:02 pm »
But I never saw anything like that happen before ... There must be something Nspire-related I forgot to setup ... Could TCT_Local_Interrupts(int) be the cause of this ?

Could it be because of the same logic as with how slow it is to draw TI-84 Plus C Silver Edition pixels compared to TI-84 Plus Silver Edition ones due to the pixel data being much larger? I know the Nspire calcs are much faster and that the color ones can be overclocked higher, but still.

Offline Matrefeytontias

  • Axe roxxor (kinda)
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1982
  • Rating: +310/-12
  • Axe roxxor
    • View Profile
    • RMV Pixel Engineers
Re: [Ndless] Help with bottleneck on color calcs only
« Reply #29 on: June 27, 2014, 06:13:00 pm »
As I said, I set up both GS and color screen so they use the same number of bits for a pixel, for instance 16.