Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Fri Dec 14, 2018 3:03 am
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Threaded code runs very slow in Mountain Lion
PostPosted: Sat Feb 02, 2013 8:41 am 
Offline

Joined: Wed Jul 01, 2009 10:11 am
Posts: 19
Location: Belgium
I am using RB2011R4.3
My code was running decently fast on a MB13" dual core 2.4HGz (with OSX 10.6.8).
I switched to a MB15" with i7 2.6 GHz (OSX 10.8.2) and the code that is put in threads runs much slower (about 5 to 8 times).
The code in the main app runs faster than before.

Do I have something to do when setting up the tread on Mountain Lion?
I already set its priority to High but it makes no difference.
The CPU load is also very low when the code runs, explaining why it is so slow.

Any help will be highly appreciated.

Xavier

_________________
MB 13" 2.4GHz 2GB - RB2009-R1


Top
 Profile  
Reply with quote  
 Post subject: Re: Threaded code runs very slow in Mountain Lion
PostPosted: Sat Feb 02, 2013 8:48 am 
Offline

Joined: Wed Feb 04, 2009 1:43 pm
Posts: 427
You do not need anything special for any OSX version.
And best to leave the priority to default.

Maybe start telling us what you actually are doing in the thread.


Top
 Profile  
Reply with quote  
 Post subject: Re: Threaded code runs very slow in Mountain Lion
PostPosted: Thu Feb 07, 2013 3:40 pm 
Offline

Joined: Wed Jul 01, 2009 10:11 am
Posts: 19
Location: Belgium
I did some more tests.
The same code in the main app (not in thread) also runs slow.
It seems to be linked to what I am doing...

I do a lot of string processing (in a big array, up to 5E6 lines).
Could it be linked to string encoding (UTF, ansi, ...) that is different on 10.8?
It's still much faster on my oder MacBook with 10.6.8.
What puzzles me is that the processor load is also pretty light.

When I run the same code on Windows 7 (same machine), I can see that the processor cores are much more pushed.
And it is also much faster...

Still a big mystery...

_________________
MB 13" 2.4GHz 2GB - RB2009-R1


Top
 Profile  
Reply with quote  
 Post subject: Re: Threaded code runs very slow in Mountain Lion
PostPosted: Fri Feb 08, 2013 12:53 am 
Offline

Joined: Mon Aug 15, 2011 10:25 pm
Posts: 293
When processing strings, the value is passed through to any sub functions, unless you mark the parameters as ByRef.. You can also try using a MemoryBlock to do your parsing..

_________________
Real Studio 2012r1.1 | MacBook Pro i5, 10.6.8 | Windows 7


Top
 Profile  
Reply with quote  
 Post subject: Re: Threaded code runs very slow in Mountain Lion
PostPosted: Fri Feb 08, 2013 1:03 am 
Offline

Joined: Fri Jan 06, 2006 3:21 pm
Posts: 12388
Location: Portland, OR USA
shaosean wrote:
When processing strings, the value is passed through to any sub functions, unless you mark the parameters as ByRef..

Not sure how that is relevant since the string value is not copied when passed to a method, just a reference to the string.

XavLNK wrote:
What puzzles me is that the processor load is also pretty light.

Are you looking at total cpu, or the individual core? RB only uses a single core, so on a quad-core machine, it would never use more than 25% of total capacity.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group