Alaska Software Inc. - The XPP complier uses only one processor
Username: Password:
AuthorTopic: The XPP complier uses only one processor
Claudio Driussi The XPP complier uses only one processor
on Wed, 06 Nov 2019 10:16:35 +0100
Hi everybody,

I have a question for the Alaska-Software people.

I have to admit that the xpp compiler is very fast.

But lately I bought a new PC with 8 cores and each
processor is a little bit slower then my previous PC
with 4 cores, so, since the xpp comiler user only 1
core the result is a little slow down.

This is not a problem, but i use XPP within a VirtulBox
VM with Win10 so each speed improvement is appreciated.

But the real slow down is when I rebuild indexes. Some
of my installations have more then a million of records,
so rebuild index take a while. Even this task is done
by a single processor, so if it was done by more cores
the speed up should be significant.

It's really hard to do that?

Best regards.
Claudio
Matej JuracRe: The XPP complier uses only one processor
on Wed, 06 Nov 2019 11:25:18 +0100
You are right - 1.9 uses only CPU-0 (first) and so by what you write so does 2.0. I learned this the 'hard' way on Citrix server farm years ago.

There is no solution for compiler as paralelizing must be done by developers at alaska but there is not much gain to get (you rarerly do full recompile).

But on client side there is much to be done. What you have to do is:

1. randomize CPU when exe starts (cpu affinty) : there is a nice .prg by Mr. Jim Graham that does the trick

and 

2. create separate threads for reindexing processes. (Mind you will fall into i/o bottlenecks on slow or high latency LANs, but not on server side)

3. create separate thread for all work intensive processes within application to fully utilize multi core (there are few examples of multihtreaded usage in samples directory of xpp)

3. Mind that xpp is 'thread safe' but you have to check each tool you use for same requirement

There was thread in this same .generic group, started in 2012 with "use Multi-Core CPUs" by Mr. Roland and answers by Jimmy aka AUGE_OHR and Peter Alderlisten on use of _sysGetCPU and _sysgetCpu functions in xpp.


Claudio Driussi <claudio.driussi@libero.it> wrote in message news:74029e80$630bff1c$8e7cc@news.alaska-software.com...
>Hi everybody,
>
>I have a question for the Alaska-Software people.
>
>I have to admit that the xpp compiler is very fast.
>
>But lately I bought a new PC with 8 cores and each
>processor is a little bit slower then my previous PC
>with 4 cores, so, since the xpp comiler user only 1
>core the result is a little slow down.
>
>This is not a problem, but i use XPP within a VirtulBox
>VM with Win10 so each speed improvement is appreciated.
>
>But the real slow down is when I rebuild indexes. Some
>of my installations have more then a million of records,
>so rebuild index take a while. Even this task is done
>by a single processor, so if it was done by more cores
>the speed up should be significant.
>
>It's really hard to do that?
>
>Best regards.
>Claudio
Claudio Driussi Re: The XPP complier uses only one processor
on Wed, 06 Nov 2019 17:29:32 +0100
Il 06/11/19 11:25, Matej Jurac ha scritto:
> You are right - 1.9 uses only CPU-0 (first) and so by what you write so does 2.0. I learned this the 'hard' way on Citrix server farm years ago.
> 
> There is no solution for compiler as paralelizing must be done by developers at alaska but there is not much gain to get (you rarerly do full recompile).

In my case I recompile often for debugging reasons, but is only a
bunch of seconds, it's ok, and I understand the difficulties.

> But on client side there is much to be done. What you have to do is:
> 
> 1. randomize CPU when exe starts (cpu affinty) : there is a nice .prg by Mr. Jim Graham that does the trick
> 
> and
> 
> 2. create separate threads for reindexing processes. (Mind you will fall into i/o bottlenecks on slow or high latency LANs, but not on server side)

Yes I did some tests with affinity, but I haven't thought to
reindex concurrently in separate threads. That can do the trick.

> 3. create separate thread for all work intensive processes within application to fully utilize multi core (there are few examples of multihtreaded usage in samples directory of xpp)

My users works under RDP, so get a random core for each task can help.

> 3. Mind that xpp is 'thread safe' but you have to check each tool you use for same requirement
> 
> There was thread in this same .generic group, started in 2012 with "use Multi-Core CPUs" by Mr. Roland and answers by Jimmy aka AUGE_OHR and Peter Alderlisten on use of _sysGetCPU and _sysgetCpu functions in xpp.

I will look at that.

All this triks can help but the main stream should be if Alaska guys
provide a parallel processing of time consuming tasks, but I
understand that it's hard to ask.

Thanks.

> 
> Claudio Driussi <claudio.driussi@libero.it> wrote in message news:74029e80$630bff1c$8e7cc@news.alaska-software.com...
>> Hi everybody,
>>
>> I have a question for the Alaska-Software people.
>>
>> I have to admit that the xpp compiler is very fast.
>>
>> But lately I bought a new PC with 8 cores and each
>> processor is a little bit slower then my previous PC
>> with 4 cores, so, since the xpp comiler user only 1
>> core the result is a little slow down.
>>
>> This is not a problem, but i use XPP within a VirtulBox
>> VM with Win10 so each speed improvement is appreciated.
>>
>> But the real slow down is when I rebuild indexes. Some
>> of my installations have more then a million of records,
>> so rebuild index take a while. Even this task is done
>> by a single processor, so if it was done by more cores
>> the speed up should be significant.
>>
>> It's really hard to do that?
>>
>> Best regards.
>> Claudio
Matej JuracRe: The XPP complier uses only one processor
on Thu, 07 Nov 2019 08:58:35 +0100
Just some words on:
> All this triks can help but the main stream should be if Alaska guys
> provide a parallel processing of time consuming tasks, but I
> understand that it's hard to ask.

Alaska provides framework that is capable of this (well some more detailed
documentation could be provided) but it is on you to modify software you write
to make it multi-cpu and multi-thread capable.

You do not modify everything just critical elements: As Mr. Jim Lee pointed out.
And the easiest part is to start routine for invoicing or routine for ledger
in separate thread on call.

It is trivial task, is not without caveats, but it brings benefits too.




Claudio Driussi <claudio.driussi@libero.it> wrote in message news:6ab222d$713e1e60$91f71@news.alaska-software.com...
>Il 06/11/19 11:25, Matej Jurac ha scritto:
>> You are right - 1.9 uses only CPU-0 (first) and so by what you write so does 2.0. I learned this the 'hard' way on Citrix server farm years ago.
>> 
>> There is no solution for compiler as paralelizing must be done by developers at alaska but there is not much gain to get (you rarerly do full recompile).
>
>In my case I recompile often for debugging reasons, but is only a
>bunch of seconds, it's ok, and I understand the difficulties.
>
>> But on client side there is much to be done. What you have to do is:
>> 
>> 1. randomize CPU when exe starts (cpu affinty) : there is a nice .prg by Mr. Jim Graham that does the trick
>> 
>> and
>> 
>> 2. create separate threads for reindexing processes. (Mind you will fall into i/o bottlenecks on slow or high latency LANs, but not on server side)
>
>Yes I did some tests with affinity, but I haven't thought to
>reindex concurrently in separate threads. That can do the trick.
>
>> 3. create separate thread for all work intensive processes within application to fully utilize multi core (there are few examples of multihtreaded usage in samples directory of xpp)
>
>My users works under RDP, so get a random core for each task can help.
>
>> 3. Mind that xpp is 'thread safe' but you have to check each tool you use for same requirement
>> 
>> There was thread in this same .generic group, started in 2012 with "use Multi-Core CPUs" by Mr. Roland and answers by Jimmy aka AUGE_OHR and Peter Alderlisten on use of _sysGetCPU and _sysgetCpu functions in xpp.
>
>I will look at that.
>
>All this triks can help but the main stream should be if Alaska guys
>provide a parallel processing of time consuming tasks, but I
>understand that it's hard to ask.
>
>Thanks.
>
>> 
>> Claudio Driussi <claudio.driussi@libero.it> wrote in message news:74029e80$630bff1c$8e7cc@news.alaska-software.com...
>>> Hi everybody,
>>>
>>> I have a question for the Alaska-Software people.
>>>
>>> I have to admit that the xpp compiler is very fast.
>>>
>>> But lately I bought a new PC with 8 cores and each
>>> processor is a little bit slower then my previous PC
>>> with 4 cores, so, since the xpp comiler user only 1
>>> core the result is a little slow down.
>>>
>>> This is not a problem, but i use XPP within a VirtulBox
>>> VM with Win10 so each speed improvement is appreciated.
>>>
>>> But the real slow down is when I rebuild indexes. Some
>>> of my installations have more then a million of records,
>>> so rebuild index take a while. Even this task is done
>>> by a single processor, so if it was done by more cores
>>> the speed up should be significant.
>>>
>>> It's really hard to do that?
>>>
>>> Best regards.
>>> Claudio
Jim LeeRe: The XPP complier uses only one processor
on Wed, 06 Nov 2019 22:51:34 +0100
hi,

you bought "wrong" PC ...

before Xbase++ v1.8x it use "all" CPU but Alaska have Problem with MT so i 
was reduce to Single-CPU
MT wil not help you if your Code is not optimize for it ... that is also in
other xBase Dialect.

---

if you want to use MT for reindex think about "split it"
let say you have 80 DBF so "split it" into 8 x 10.

now start your App and assign it to CPU. so you can run 8 x Apps on 8 Core 
to reindex your DBF

---

when have so many Records you shoud think about SQL. you can try PgDBE ... i
prefer native LibPQ Way



---
Diese E-Mail wurde von AVG auf Viren geprüft.
http://www.avg.com