Re: Dropbox Upload and Dropbox Download Methods

2019-03-08 Thread Kirk Brooks via 4D_Tech
Tim,
Thanks for sharing this.

On Fri, Mar 8, 2019 at 3:55 PM Tim Nevels via 4D_Tech <4d_tech@lists.4d.com>
wrote:

> A few weeks ago I posted a message asking if anyone had written code to
> upload and download files to Dropbox. Got no responses other than “the API
> looks like it is easy to do”.
>
> Today I spent time writing a couple of methods to allow uploading and
> downloading files from Dropbox with native 4D commands using the Dropbox v2
> API. And people were right, it was not too difficult. The v2 API is
> implemented very nicely and documented fairly well. I found a few
> documentation errors, but they were easily dealt with.
>
> 4D v17 provided all the commands needed to make it all work with very
> little code. Doing this with NTK would easily take 3 times the amount of
> code.
>
> My current needs are very simple. I want to upload a file to Dropbox and
> replace any existing file if necessary. Dropbox maximum file size for a
> single upload operation is 150MB. That’s more than enough for my needs. But
> if you want to upload larger files — up to the Dropbox API max size of
> 350MB — you’ll have to implement an “upload session”.
>
> Download requirements are also simple. Just download a file from a Dropbox
> path to a path on your hard drive. Dropbox paths are in POSIX format.
>
> The Dropbox v2 API uses OAuth 2, but that basically boils down to creating
> an “App” and getting an “access token” the you use with all the API calls.
> I’ll leave it up to you to go read the docs and set that all up. It’s easy.
>
> The code uses dot notation, but with a little work it could be ported to
> work with older versions for 4D probably back to v14. Code is
> cross-platform without any extra effort needed.
>
> Here is me giving back to the group so you don’t have to spend a day
> developing and testing code. If others implement more of the Dropbox v2
> API, please post it to the iNUG to help others.
>
>   // ===
>   // PROJECT METHOD: Dropbox_UploadFile
>
>   // PARAMETERS: $0 = results object
>   // $1 = dropbox access token
>   // $2 = dropbox path
>   // $3 = file path
>
>   // DESCRIPTION: Uploads a file to Dropbox using the v2 API
>   // Max upload size in a single transfer is 150MB.
>
>   // https://www.dropbox.com/developers/documentation/http/documentation
>
>   // CREATED BY: Tim Nevels, Innovative Solutions ©2019
>   // DATE: 3/8/19
>   // LAST MODIFIED:
>   // 
>
> C_OBJECT($0;$results_o)
> C_TEXT($1;$dropboxAccessToken_t)
> C_TEXT($2;$dropboxPath_t)
> C_TEXT($3;$filePath_t)
> $dropboxAccessToken_t:=$1
> $dropboxPath_t:=$2
> $filePath_t:=$3
>
>   // declare local variables
> C_TEXT($headerValue_t;$requestURL_t;$response_t)
> C_LONGINT($statusCode_l)
> C_BLOB($content_x)
> C_OBJECT($headerValue_o;$response_o)
> ARRAY TEXT($headerName_at;0)
> ARRAY TEXT($headerValue_at;0)
>
>   // setup http header
> APPEND TO ARRAY($headerName_at;"Authorization")
> APPEND TO ARRAY($headerValue_at;"Bearer "+$dropboxAccessToken_t)
>
>   // set upload header values
> APPEND TO ARRAY($headerName_at;"Content-Type")
> APPEND TO ARRAY($headerValue_at;"application/octet-stream”)
>
> APPEND TO ARRAY($headerName_at;"Dropbox-API-Arg")
> $headerValue_o:=New object(\
> "path";$dropboxPath_t;\
> "mode";"add";\
> "autorename";False)  // overwrite any existing file
> $headerValue_t:=JSON Stringify($headerValue_o)
> APPEND TO ARRAY($headerValue_at;$headerValue_t)
>
>   // set url
> $requestURL_t:="https://content.dropboxapi.com/2/files/upload";
>
>   // load the file
> DOCUMENT TO BLOB($filePath_t;$content_x)
>
>   // check file size
> If (BLOB size($content_x)>(1024*1024*149))  // over 149MB, too close to
> limit to try
> $results_o:=New object(\
> "success";False;\
> "statusCode";408;\
> "errorMessage";"File is to large to upload in one piece")
> Else
>   // upload the file
> HTTP SET OPTION(HTTP compression;1)  // do compression
> HTTP SET OPTION(HTTP timeout;60*10)  // 10 minute timeout
> $statusCode_l:=HTTP Request(HTTP POST
> method;$requestURL_t;$content_x;$response_t;$headerName_at;$headerValue_at)
>
>   // build results object
> Case of
> : ($statusCode_l=200)  // upload was a success
> $results_o:=New object(\
> "success";True;\
> "statusCode";$statusCode_l;\
> "errorMessage";"File upload was successful")
>
> : ($statusCode_l=409)  // endpoint specific problem
> $response_o:=JSON Parse($response_t)
> $results_o:=New object(\
> "success";False;\
> "statusCode";$statusCode_l;\
> "errorMessage";$response_o.error_summary)
>
> Else   // other problem
> $results_o:=New object(\
>  

Build STR# 10135, 18/19 Folders

2019-03-08 Thread John J Foster via 4D_Tech
Hey All,

Windows 10 - 4D v17r4

I just noticed that the build of an engined version of my app creates two 
folders (as it should) named:

STR# 10135, 18 -> Appname.4dbase -> includes the .4DC/.4DIndy files
STR# 10135, 19 -> Appname -> includes executable

Is this related to the application build XML or JSON file?

I will need both of these folders as part of the “App”. I’m so use to a 
Macintosh application or running a 4D Server where access is via a client. And 
I haven't had to create a standalone app since DataPulse/StructurePulse 10 
years ago.

I’ll be researching in KB for best way to organize these windows folders, to 
using the build file (xml or json), where to place the image, etc. A number of 
TN's but mostly from back in 4D 2004 days.

Thanks for your help,
John…

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Windows app 3-4 times slower

2019-03-08 Thread John J Foster via 4D_Tech
Hi Tom,

I do have Parallels but it’s currently running windows 7 I think.

I think it would be a good idea to get windows 10 and install it with Parallels 
and see how that works out. Like you say it would be a better comparison then.

OTOH, now that I realize I have a slow laptop, it gives me a good testing 
machine to see how other with a slow computer will experience this app.

Appreciate,
John...

> On Mar 8, 2019, at 3:39 PM, Tom Benedict  wrote:
> 
> Hi John,
> 
> I don’t know whether anyone has already mentioned this, but you might 
> consider installing Windows on your MacBook Pro. That would make it easier to 
> compare apples to apples (ha! I made a joke!). 
> 
> Anyhow, you can use Apple’s Bootcamp to install and run Windows on your 
> MacBook or you can purchase Parallels or VMWare then run Windows in one of 
> those environments. You’ll have to purchase a copy of Windows too. At least 
> then you’ll take the hardware out of the equation.
> 
> HTH,
> 
> Tom Benedict
> 

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Dropbox Upload and Dropbox Download Methods

2019-03-08 Thread Tim Nevels via 4D_Tech
A few weeks ago I posted a message asking if anyone had written code to upload 
and download files to Dropbox. Got no responses other than “the API looks like 
it is easy to do”. 

Today I spent time writing a couple of methods to allow uploading and 
downloading files from Dropbox with native 4D commands using the Dropbox v2 
API. And people were right, it was not too difficult. The v2 API is implemented 
very nicely and documented fairly well. I found a few documentation errors, but 
they were easily dealt with. 

4D v17 provided all the commands needed to make it all work with very little 
code. Doing this with NTK would easily take 3 times the amount of code.

My current needs are very simple. I want to upload a file to Dropbox and 
replace any existing file if necessary. Dropbox maximum file size for a single 
upload operation is 150MB. That’s more than enough for my needs. But if you 
want to upload larger files — up to the Dropbox API max size of 350MB — you’ll 
have to implement an “upload session”. 

Download requirements are also simple. Just download a file from a Dropbox path 
to a path on your hard drive. Dropbox paths are in POSIX format. 

The Dropbox v2 API uses OAuth 2, but that basically boils down to creating an 
“App” and getting an “access token” the you use with all the API calls. I’ll 
leave it up to you to go read the docs and set that all up. It’s easy. 

The code uses dot notation, but with a little work it could be ported to work 
with older versions for 4D probably back to v14. Code is cross-platform without 
any extra effort needed.

Here is me giving back to the group so you don’t have to spend a day developing 
and testing code. If others implement more of the Dropbox v2 API, please post 
it to the iNUG to help others.

  // ===
  // PROJECT METHOD: Dropbox_UploadFile

  // PARAMETERS: $0 = results object
  // $1 = dropbox access token
  // $2 = dropbox path
  // $3 = file path

  // DESCRIPTION: Uploads a file to Dropbox using the v2 API
  // Max upload size in a single transfer is 150MB.

  // https://www.dropbox.com/developers/documentation/http/documentation

  // CREATED BY: Tim Nevels, Innovative Solutions ©2019
  // DATE: 3/8/19
  // LAST MODIFIED: 
  // 

C_OBJECT($0;$results_o)
C_TEXT($1;$dropboxAccessToken_t)
C_TEXT($2;$dropboxPath_t)
C_TEXT($3;$filePath_t)
$dropboxAccessToken_t:=$1
$dropboxPath_t:=$2
$filePath_t:=$3

  // declare local variables
C_TEXT($headerValue_t;$requestURL_t;$response_t)
C_LONGINT($statusCode_l)
C_BLOB($content_x)
C_OBJECT($headerValue_o;$response_o)
ARRAY TEXT($headerName_at;0)
ARRAY TEXT($headerValue_at;0)

  // setup http header
APPEND TO ARRAY($headerName_at;"Authorization")
APPEND TO ARRAY($headerValue_at;"Bearer "+$dropboxAccessToken_t)

  // set upload header values
APPEND TO ARRAY($headerName_at;"Content-Type")
APPEND TO ARRAY($headerValue_at;"application/octet-stream”)

APPEND TO ARRAY($headerName_at;"Dropbox-API-Arg")
$headerValue_o:=New object(\
"path";$dropboxPath_t;\
"mode";"add";\
"autorename";False)  // overwrite any existing file
$headerValue_t:=JSON Stringify($headerValue_o)
APPEND TO ARRAY($headerValue_at;$headerValue_t)

  // set url
$requestURL_t:="https://content.dropboxapi.com/2/files/upload";

  // load the file
DOCUMENT TO BLOB($filePath_t;$content_x)

  // check file size
If (BLOB size($content_x)>(1024*1024*149))  // over 149MB, too close to limit 
to try
$results_o:=New object(\
"success";False;\
"statusCode";408;\
"errorMessage";"File is to large to upload in one piece")
Else 
  // upload the file
HTTP SET OPTION(HTTP compression;1)  // do compression
HTTP SET OPTION(HTTP timeout;60*10)  // 10 minute timeout
$statusCode_l:=HTTP Request(HTTP POST 
method;$requestURL_t;$content_x;$response_t;$headerName_at;$headerValue_at)

  // build results object
Case of 
: ($statusCode_l=200)  // upload was a success
$results_o:=New object(\
"success";True;\
"statusCode";$statusCode_l;\
"errorMessage";"File upload was successful")

: ($statusCode_l=409)  // endpoint specific problem
$response_o:=JSON Parse($response_t)
$results_o:=New object(\
"success";False;\
"statusCode";$statusCode_l;\
"errorMessage";$response_o.error_summary)

Else   // other problem
$results_o:=New object(\
"success";False;\
"statusCode";$statusCode_l;\
"errorMessage";"HTTP Request failed"+Char(Carriage 
return)+Char(Carriage return)+\
$response_t)
End case

Re: Windows app 3-4 times slower

2019-03-08 Thread Tom Benedict via 4D_Tech
Hi John,

I don’t know whether anyone has already mentioned this, but you might consider 
installing Windows on your MacBook Pro. That would make it easier to compare 
apples to apples (ha! I made a joke!). 

Anyhow, you can use Apple’s Bootcamp to install and run Windows on your MacBook 
or you can purchase Parallels or VMWare then run Windows in one of those 
environments. You’ll have to purchase a copy of Windows too. At least then 
you’ll take the hardware out of the equation.

HTH,

Tom Benedict

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Windows app 3-4 times slower

2019-03-08 Thread John J Foster via 4D_Tech
Hey Chip,

Thanks for the info. Very helpful.

I tend to bury my head in the sand when it comes to hardware. But now I need to 
pull it back out so my perspective is correct.

Appreciate,
John…



> On Mar 8, 2019, at 2:49 PM, Chip Scheide <4d_o...@pghrepository.org> wrote:
> 
> in speed  order
> i3, i5, i7, i9
> 
> mobile versions are slower then desktop versions of the same processor (not 
> all 'i' processors have mobile versions).
> 
> here are 2 sites to look at:
> Toms hardware - simple processor comparisons
> https://www.tomshardware.com/reviews/cpu-hierarchy,4312.html
> 
> Intel's own detailed comparisons
> https://www.intel.com/content/www/us/en/support/articles/05505/processors.html
> 
> 
> I did not see the specific i3 you  mentioned, but the i3 tested is roughly 
> 1/2 the rating of the i7
> 
> Chip
> 
>> Hi Randy,
>> 
>>> Processor:  i3 vs i7 
>> 
>> Is it really that much slower?
>> 
>> If so then I got duped as I thought I was getting a reasonably faster 
>> Laptop 6 months ago.
>> 
>> Thanks,
>> John…
>> 
>> 
>> **
>> 4D Internet Users Group (4D iNUG)
>> Archive:  http://lists.4d.com/archives.html
>> Options: https://lists.4d.com/mailman/options/4d_tech
>> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
>> **
> 
> Hell is other people 
> Jean-Paul Sartre

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Windows app 3-4 times slower

2019-03-08 Thread Kenneth Geiger via 4D_Tech
Hi John,

One more thing… That MacBook Pro has an SSD in it (Apple has not put spinny 
hard-drives in their laptops since 2012.) If your Windows machine does not have 
an SSD, that would make a HUGE difference.

Regards,

Ken

> On Mar 8, 2019, at 1:50 PM, John J Foster via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> Hi All,
> 
> This App is running under both Mac/Windows 4D v17R4...
> 
> You might recall, a week ago or so, that I was soliciting help with creating 
> an engined based 4D App. I figured that part out (although certification 
> later). What I am finding baffling is how much slower the engine runs on 
> windows versus on my MacBook Pro. When I say slower I seeing the Mac being 
> 3-4 times faster in various scenarios.
> 
> Part of the speed differentials might be a special plugin that the App uses. 
> The plugin was created using Xcode for the Mac and Visual Studio (v15 I 
> think) for windows. I’ll have to create special test to compare and see. The 
> SVG drawing is slower; the searching in a database seems much slower.
> 
> A special search routine, which requires calls to the plugin, took 1 minute 4 
> seconds on the Mac and the same thing on window took over 4 minutes - 
> compiled. BTW, the same routine running as source on the Mac took 3 minutes 
> 41 seconds and on window took 10 minutes and 46 seconds (over twice as slow). 
> Maybe the windows version of the plugin (there’s both a 32bit and a 64bit) 
> has some other setting which can optimize it?
> 
> FWIW, I have been trying to get by using as much of native 4D as I can and as 
> little of the plugin as is required. I might have to reconsider this and move 
> some of this work from 4D into the C++ plugin since calculating in the plugin 
> it’s so much faster…
> 
> On the Mac side:
> 
> MacBook Pro (Retina, 15-inch, Mid 2015)
> System Version:   macOS 10.12.6 (16G1618)
> 
> Processor Name:   Intel Core i7
> Processor Speed:  2.8 GHz
> Number of Processors: 1
> Total Number of Cores:4
> L2 Cache (per Core):  256 KB
> L3 Cache: 6 MB
> Memory:   16 GB
> 
> On Windows:
> 
> HP Notebook x64-bassed PC
> System Version:   Windows 10 Home (10.0.17134)
> 
> Processor Name:   Intel Core i3-6100U
> Processor Speed:  2.30 GHz
> Number of Processors: 4 logical
> Memory:   8 GB {not sure if I can add more?}
> 
> My past experience has been that it’s usually slower on the Mac and much 
> faster on windows. But these are different times. Both the Mac and Windows 
> have Bitdefender running for security. (It’s probable that there are other 
> programs running on windows I am unaware of).
> 
> This single user standalone app will be marketed to a client base which will 
> not have necessarily have the fastest equipment. So anything I can do - not 
> necessarily hardware based - to speed things up will be helpful.
> 
> For those of you who work on both modern Macs and Windows what is your 
> experience in terms of speed comparison?
> 
> When I move a database over from a Mac to a windows do I need to throw all 
> the indexes away and have them rebuilt? {I don’t think so since if it were 
> running via 4D Server wouldn’t be an issue}
> 
> Are there steps you’ve taken that sped things up?
> 
> I might have to work with 4D’s profiler and some other test to determine the 
> bottlenecks. Way too slow!
> 
> Thanks for your feedback,
> John…
> 
> 
> 
> **
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Windows app 3-4 times slower

2019-03-08 Thread Chip Scheide via 4D_Tech
in speed  order
i3, i5, i7, i9

mobile versions are slower then desktop versions of the same processor (not all 
'i' processors have mobile versions).

here are 2 sites to look at:
Toms hardware - simple processor comparisons
https://www.tomshardware.com/reviews/cpu-hierarchy,4312.html

Intel's own detailed comparisons
https://www.intel.com/content/www/us/en/support/articles/05505/processors.html


I did not see the specific i3 you  mentioned, but the i3 tested is roughly 1/2 
the rating of the i7

Chip

> Hi Randy,
> 
>> Processor:  i3 vs i7 
> 
> Is it really that much slower?
> 
> If so then I got duped as I thought I was getting a reasonably faster 
> Laptop 6 months ago.
> 
> Thanks,
> John…
> 
> 
> **
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **

Hell is other people 
 Jean-Paul Sartre
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Windows app 3-4 times slower

2019-03-08 Thread John J Foster via 4D_Tech
Hi Ken,

Yea I’m beginning to see that the windows laptop is a lot slower then the 
MacBook Pro.

So maybe I do need a newer laptop just for testing purposes. Then I can see how 
fast it will be across a range of processors. I want to know what the potential 
user base will experience so I can frame the perception.

And yes, RAM would definitely improve the overall performance. But I’ll put 
those dollars towards a newer one I think.

Appreciate,
John...

> The i3 only has two physical processing cores, each of which may operate with 
> two logical processors. Logical processors running on one physical core are 
> no where as speedy as two physically independent cores. Also 8-GB of RAM vs. 
> 16-GB of RAM certainly will affect throughput. 
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Windows app 3-4 times slower

2019-03-08 Thread John J Foster via 4D_Tech
Hey Chuck,

Yea I know the drive is slower on the PC as it’s not an SSD.

I misspoke to Randy when I said I had purchased it 6 months ago. That’s not so. 
This was purchased from Costco in 2017 I think. (There is another that my 
girl-friend is using purchase 6 months ago).

Anyway, it appears that it’s s slow machine so maybe a test on another more 
recent windows laptop and maybe a but less freak out! 

Thanks,
John...

> what is the drive in both. Perhaps Mac has SSD and windows has slow HD 

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Windows app 3-4 times slower

2019-03-08 Thread John J Foster via 4D_Tech
Hi Randy,

> Processor:  i3 vs i7 

Is it really that much slower?

If so then I got duped as I thought I was getting a reasonably faster Laptop 6 
months ago.

Thanks,
John…


**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Windows app 3-4 times slower

2019-03-08 Thread Kenneth Geiger via 4D_Tech
Hi John,

The i3 only has two physical processing cores, each of which may operate with 
two logical processors. Logical processors running on one physical core are no 
where as speedy as two physically independent cores. Also 8-GB of RAM vs. 16-GB 
of RAM certainly will affect throughput.

Regards,

Ken

> On Mar 8, 2019, at 1:50 PM, John J Foster via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> Hi All,
> 
> This App is running under both Mac/Windows 4D v17R4...
> 
> You might recall, a week ago or so, that I was soliciting help with creating 
> an engined based 4D App. I figured that part out (although certification 
> later). What I am finding baffling is how much slower the engine runs on 
> windows versus on my MacBook Pro. When I say slower I seeing the Mac being 
> 3-4 times faster in various scenarios.
> 
> Part of the speed differentials might be a special plugin that the App uses. 
> The plugin was created using Xcode for the Mac and Visual Studio (v15 I 
> think) for windows. I’ll have to create special test to compare and see. The 
> SVG drawing is slower; the searching in a database seems much slower.
> 
> A special search routine, which requires calls to the plugin, took 1 minute 4 
> seconds on the Mac and the same thing on window took over 4 minutes - 
> compiled. BTW, the same routine running as source on the Mac took 3 minutes 
> 41 seconds and on window took 10 minutes and 46 seconds (over twice as slow). 
> Maybe the windows version of the plugin (there’s both a 32bit and a 64bit) 
> has some other setting which can optimize it?
> 
> FWIW, I have been trying to get by using as much of native 4D as I can and as 
> little of the plugin as is required. I might have to reconsider this and move 
> some of this work from 4D into the C++ plugin since calculating in the plugin 
> it’s so much faster…
> 
> On the Mac side:
> 
> MacBook Pro (Retina, 15-inch, Mid 2015)
> System Version:   macOS 10.12.6 (16G1618)
> 
> Processor Name:   Intel Core i7
> Processor Speed:  2.8 GHz
> Number of Processors: 1
> Total Number of Cores:4
> L2 Cache (per Core):  256 KB
> L3 Cache: 6 MB
> Memory:   16 GB
> 
> On Windows:
> 
> HP Notebook x64-bassed PC
> System Version:   Windows 10 Home (10.0.17134)
> 
> Processor Name:   Intel Core i3-6100U
> Processor Speed:  2.30 GHz
> Number of Processors: 4 logical
> Memory:   8 GB {not sure if I can add more?}
> 
> My past experience has been that it’s usually slower on the Mac and much 
> faster on windows. But these are different times. Both the Mac and Windows 
> have Bitdefender running for security. (It’s probable that there are other 
> programs running on windows I am unaware of).
> 
> This single user standalone app will be marketed to a client base which will 
> not have necessarily have the fastest equipment. So anything I can do - not 
> necessarily hardware based - to speed things up will be helpful.
> 
> For those of you who work on both modern Macs and Windows what is your 
> experience in terms of speed comparison?
> 
> When I move a database over from a Mac to a windows do I need to throw all 
> the indexes away and have them rebuilt? {I don’t think so since if it were 
> running via 4D Server wouldn’t be an issue}
> 
> Are there steps you’ve taken that sped things up?
> 
> I might have to work with 4D’s profiler and some other test to determine the 
> bottlenecks. Way too slow!
> 
> Thanks for your feedback,
> John…
> 
> 
> 
> **
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

RE: Windows app 3-4 times slower

2019-03-08 Thread Randy Engle via 4D_Tech
John,

Processor:  i3 vs i7 

Randy Engle

-Original Message-
From: 4D_Tech <4d_tech-boun...@lists.4d.com> On Behalf Of John J Foster via 
4D_Tech
Sent: Friday, March 8, 2019 12:51 PM
To: 4D iNug Technical <4d_tech@lists.4d.com>
Cc: John J Foster 
Subject: Windows app 3-4 times slower

Hi All,

This App is running under both Mac/Windows 4D v17R4...

You might recall, a week ago or so, that I was soliciting help with creating an 
engined based 4D App. I figured that part out (although certification later). 
What I am finding baffling is how much slower the engine runs on windows versus 
on my MacBook Pro. When I say slower I seeing the Mac being 3-4 times faster in 
various scenarios.

Part of the speed differentials might be a special plugin that the App uses. 
The plugin was created using Xcode for the Mac and Visual Studio (v15 I think) 
for windows. I’ll have to create special test to compare and see. The SVG 
drawing is slower; the searching in a database seems much slower.

A special search routine, which requires calls to the plugin, took 1 minute 4 
seconds on the Mac and the same thing on window took over 4 minutes - compiled. 
BTW, the same routine running as source on the Mac took 3 minutes 41 seconds 
and on window took 10 minutes and 46 seconds (over twice as slow). Maybe the 
windows version of the plugin (there’s both a 32bit and a 64bit) has some other 
setting which can optimize it?

FWIW, I have been trying to get by using as much of native 4D as I can and as 
little of the plugin as is required. I might have to reconsider this and move 
some of this work from 4D into the C++ plugin since calculating in the plugin 
it’s so much faster…

On the Mac side:

MacBook Pro (Retina, 15-inch, Mid 2015)
System Version: macOS 10.12.6 (16G1618)

 Processor Name:Intel Core i7
 Processor Speed:   2.8 GHz
 Number of Processors:  1
 Total Number of Cores: 4
 L2 Cache (per Core):   256 KB
 L3 Cache:  6 MB
 Memory:16 GB

On Windows:

HP Notebook x64-bassed PC
System Version: Windows 10 Home (10.0.17134)

 Processor Name:Intel Core i3-6100U
 Processor Speed:   2.30 GHz
 Number of Processors:  4 logical
 Memory:8 GB {not sure if I can add more?}

My past experience has been that it’s usually slower on the Mac and much faster 
on windows. But these are different times. Both the Mac and Windows have 
Bitdefender running for security. (It’s probable that there are other programs 
running on windows I am unaware of).

This single user standalone app will be marketed to a client base which will 
not have necessarily have the fastest equipment. So anything I can do - not 
necessarily hardware based - to speed things up will be helpful.

For those of you who work on both modern Macs and Windows what is your 
experience in terms of speed comparison?

When I move a database over from a Mac to a windows do I need to throw all the 
indexes away and have them rebuilt? {I don’t think so since if it were running 
via 4D Server wouldn’t be an issue}

Are there steps you’ve taken that sped things up?

I might have to work with 4D’s profiler and some other test to determine the 
bottlenecks. Way too slow!

Thanks for your feedback,
John…



**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Windows app 3-4 times slower

2019-03-08 Thread Charles Miller via 4D_Tech
what is the drive in both. Perhaps Mac has SSD and windows has slow HD

Regards

Chuck

On Fri, Mar 8, 2019 at 3:51 PM John J Foster via 4D_Tech
<4d_tech@lists.4d.com> wrote:
>
> Hi All,
>
> This App is running under both Mac/Windows 4D v17R4...
>
> You might recall, a week ago or so, that I was soliciting help with creating 
> an engined based 4D App. I figured that part out (although certification 
> later). What I am finding baffling is how much slower the engine runs on 
> windows versus on my MacBook Pro. When I say slower I seeing the Mac being 
> 3-4 times faster in various scenarios.
>
> Part of the speed differentials might be a special plugin that the App uses. 
> The plugin was created using Xcode for the Mac and Visual Studio (v15 I 
> think) for windows. I’ll have to create special test to compare and see. The 
> SVG drawing is slower; the searching in a database seems much slower.
>
> A special search routine, which requires calls to the plugin, took 1 minute 4 
> seconds on the Mac and the same thing on window took over 4 minutes - 
> compiled. BTW, the same routine running as source on the Mac took 3 minutes 
> 41 seconds and on window took 10 minutes and 46 seconds (over twice as slow). 
> Maybe the windows version of the plugin (there’s both a 32bit and a 64bit) 
> has some other setting which can optimize it?
>
> FWIW, I have been trying to get by using as much of native 4D as I can and as 
> little of the plugin as is required. I might have to reconsider this and move 
> some of this work from 4D into the C++ plugin since calculating in the plugin 
> it’s so much faster…
>
> On the Mac side:
>
> MacBook Pro (Retina, 15-inch, Mid 2015)
> System Version: macOS 10.12.6 (16G1618)
>
>  Processor Name:Intel Core i7
>  Processor Speed:   2.8 GHz
>  Number of Processors:  1
>  Total Number of Cores: 4
>  L2 Cache (per Core):   256 KB
>  L3 Cache:  6 MB
>  Memory:16 GB
>
> On Windows:
>
> HP Notebook x64-bassed PC
> System Version: Windows 10 Home (10.0.17134)
>
>  Processor Name:Intel Core i3-6100U
>  Processor Speed:   2.30 GHz
>  Number of Processors:  4 logical
>  Memory:8 GB {not sure if I can add more?}
>
> My past experience has been that it’s usually slower on the Mac and much 
> faster on windows. But these are different times. Both the Mac and Windows 
> have Bitdefender running for security. (It’s probable that there are other 
> programs running on windows I am unaware of).
>
> This single user standalone app will be marketed to a client base which will 
> not have necessarily have the fastest equipment. So anything I can do - not 
> necessarily hardware based - to speed things up will be helpful.
>
> For those of you who work on both modern Macs and Windows what is your 
> experience in terms of speed comparison?
>
> When I move a database over from a Mac to a windows do I need to throw all 
> the indexes away and have them rebuilt? {I don’t think so since if it were 
> running via 4D Server wouldn’t be an issue}
>
> Are there steps you’ve taken that sped things up?
>
> I might have to work with 4D’s profiler and some other test to determine the 
> bottlenecks. Way too slow!
>
> Thanks for your feedback,
> John…
>
>
>
> **
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **



-- 
-
 Chuck Miller Voice: (617) 739-0306 Fax: (617) 232-1064
 Informed Solutions, Inc.
 Brookline, MA 02446 USA Registered 4D Developer
   Providers of 4D, Sybase & SQL Server connectivity
  http://www.informed-solutions.com
-
This message and any attached documents contain information which may
be confidential, subject to privilege or exempt from disclosure under
applicable law.  These materials are intended only for the use of the
intended recipient. If you are not the intended recipient of this
transmission, you are hereby notified that any distribution,
disclosure, printing, copying, storage, modification or the taking of
any action in reliance upon this transmission is strictly prohibited.
Delivery of this message to any person other than the intended
recipient shall not compromise or waive such confidentiality,
privilege or exemption from disclosure as to this communication.
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Windows app 3-4 times slower

2019-03-08 Thread John J Foster via 4D_Tech
Hi All,

This App is running under both Mac/Windows 4D v17R4...

You might recall, a week ago or so, that I was soliciting help with creating an 
engined based 4D App. I figured that part out (although certification later). 
What I am finding baffling is how much slower the engine runs on windows versus 
on my MacBook Pro. When I say slower I seeing the Mac being 3-4 times faster in 
various scenarios.

Part of the speed differentials might be a special plugin that the App uses. 
The plugin was created using Xcode for the Mac and Visual Studio (v15 I think) 
for windows. I’ll have to create special test to compare and see. The SVG 
drawing is slower; the searching in a database seems much slower.

A special search routine, which requires calls to the plugin, took 1 minute 4 
seconds on the Mac and the same thing on window took over 4 minutes - compiled. 
BTW, the same routine running as source on the Mac took 3 minutes 41 seconds 
and on window took 10 minutes and 46 seconds (over twice as slow). Maybe the 
windows version of the plugin (there’s both a 32bit and a 64bit) has some other 
setting which can optimize it?

FWIW, I have been trying to get by using as much of native 4D as I can and as 
little of the plugin as is required. I might have to reconsider this and move 
some of this work from 4D into the C++ plugin since calculating in the plugin 
it’s so much faster…

On the Mac side:

MacBook Pro (Retina, 15-inch, Mid 2015)
System Version: macOS 10.12.6 (16G1618)

 Processor Name:Intel Core i7
 Processor Speed:   2.8 GHz
 Number of Processors:  1
 Total Number of Cores: 4
 L2 Cache (per Core):   256 KB
 L3 Cache:  6 MB
 Memory:16 GB

On Windows:

HP Notebook x64-bassed PC
System Version: Windows 10 Home (10.0.17134)

 Processor Name:Intel Core i3-6100U
 Processor Speed:   2.30 GHz
 Number of Processors:  4 logical
 Memory:8 GB {not sure if I can add more?}

My past experience has been that it’s usually slower on the Mac and much faster 
on windows. But these are different times. Both the Mac and Windows have 
Bitdefender running for security. (It’s probable that there are other programs 
running on windows I am unaware of).

This single user standalone app will be marketed to a client base which will 
not have necessarily have the fastest equipment. So anything I can do - not 
necessarily hardware based - to speed things up will be helpful.

For those of you who work on both modern Macs and Windows what is your 
experience in terms of speed comparison?

When I move a database over from a Mac to a windows do I need to throw all the 
indexes away and have them rebuilt? {I don’t think so since if it were running 
via 4D Server wouldn’t be an issue}

Are there steps you’ve taken that sped things up?

I might have to work with 4D’s profiler and some other test to determine the 
bottlenecks. Way too slow!

Thanks for your feedback,
John…



**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**