pipeult
pipeult

Reputation: 11

Foxx app seems not compiled

I use ArangoDB on a PC Ubuntu and a Mac for quite a while without any problem. In a general way my Foxx applications worked 4 - 5 times as fast on Mac that on PC.

I passed to the version 2.7.3 on both machines. Now the Mac is slower than the PC. Worse, than the applications are in mode "Production" or "Development", her works in the same speed. I have a doubt concerning the reality of the compilation of the mode "Production". However, the command "foxx-manager list" returns well "true" and "false" according to the chosen mode.

Is there a way to check if the script of an app runs well in compiled mode or not? A suggestion?

Upvotes: 0

Views: 141

Answers (3)

dothebart
dothebart

Reputation: 6067

After a lot of research & discsions we found out two issues:

  • swagger.io which we use for API-documentation took very long to render in safari; We updated to a more recent version.
  • Apple introduced a performance regression with El Capitans xcode & clang that slow down ArangoDB up to 7 times. Using an older xcode or GCC doesn't produce slow binaries.The latest formular now strongly discourages using clang

Further discussion was held in github issue #1629

Upvotes: 0

pipeult
pipeult

Reputation: 11

I am sorry but I cannot share my data.
Here is the code I use on both machines to test the CouchDB and ArangoDB accesses. It is minimalist, brings in no personal code both on CouchDB and on ArangoDB, uses HTTP and works in local.

import requests
import time

LOOP = 500

CDB_SESS = requests.Session()
CDB_SESS.stream = False
CDB_SESS.headers.update({'content-type': 'application/json; charset=utf-8'})

ADB_SESS = requests.Session()
ADB_SESS.stream = False
ADB_SESS.headers.update({'content-type': 'application/json; charset=utf-8'})

if __name__ == '__main__':
    print 'CouchDB'
    START = time.time()
    for x in range(LOOP):
        _rsp = CDB_SESS.get('http://localhost:5984/')
        value = _rsp.json()
    STOP = time.time()
    print (STOP - START)

    print 'ArangoDB'
    START = time.time()
    for x in range(LOOP):
        _rsp = ADB_SESS.get('http://localhost:8529/_db/_system/_api/version')
        value = _rsp.json()
    STOP = time.time()
    print (STOP - START)

Both loops differ only by the used url. The databases run only internal code, not mine, right?
Is it not reasonable to think that if the bottleneck comes from Python or from Requests, this one acts here in the same way on the two databases?

Today I put aside the PC and worked on the MAC.
I uninstalled ArangoDB (brew uninstall arangodb) and cleaned the directory var/lib of its contents. Then I reinstalled it (brew install arangodb) without transferring my data or any Foxx app. One virgin install. My only operation is to have modified v8-contexts=1.

I launched the test above, 3 times. Here is the result:
- CouchDB: 1.54s, 1.49s, 1.49s
- ArangoDB: 1.05s, 1.04s, 1.05s

The results are identicaly bad as those obtained previously.
Do I have to incriminate my data (not present) or my Foxx app (not present)?

Upvotes: 1

pipeult
pipeult

Reputation: 11

I made some tests.
The versions which I use are the same on both machines for:
- CouchDB 1.6.1
- ArangoDB 2.7.3
- requests 2.9.1
except for python:
- PC 2.7.6
- MAC 2.7.11

The codes of tests are identical on both machines. I launch them 3 times, in case. The data on CouchDB and ArangoDB are identical on the PC and the MAC.

The first test is a loop of reading 500 records on CouchDB only (my source):
- on the PC: 53.36s, 53.66s, 53.59s
- on the MAC: 5.70s, 5.86s, 6.01s
The MAC it is 9-10 times as fast. The slowing down does not come from my source of data, right ?

The second test is a loop of 500 'http://localhost:5984/' on CouchDB and 500 'http://localhost:8529/db/ system/_ api/version' on ArangoDB. My code does not intervene, right ?: on the PC:
- CouchDB: 20.02s, 20.01s, 20.01s
- ArangoDB: 0.48s, 0.37s, 0.38s
The difference of speed for 'which is your version ?' is of the order of 40.

on the MAC:
- CouchDB: 1.48s, 1.49s, 1.61s
- ArangoDB: 1.07s, 1.07s, 1.13s
Where is the difference ?

Upvotes: 0

Related Questions