[jira] [Commented] (SLING-8205) stop using Class.getField() to stop spitting out NoSuchFieldException

2019-01-09 Thread Nicolas Peltier (JIRA)


[ 
https://issues.apache.org/jira/browse/SLING-8205?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16738049#comment-16738049
 ] 

Nicolas Peltier commented on SLING-8205:


raised the PR 
https://github.com/apache/sling-org-apache-sling-scripting-sightly-compiler/pull/4

> stop using Class.getField() to stop spitting out NoSuchFieldException
> -
>
> Key: SLING-8205
> URL: https://issues.apache.org/jira/browse/SLING-8205
> Project: Sling
>  Issue Type: Improvement
>  Components: Scripting
>Reporter: Nicolas Peltier
>Assignee: Nicolas Peltier
>Priority: Major
>  Time Spent: 10m
>  Remaining Estimate: 0h
>
> According to java mission control, exceptions are bad for performances, and 
> o.a.s.scripting.sightly.compiler.util.ObjectModel uses Class.getField first 
> to check if a use member is a simple field or a method, which generates 
> *lots* of exceptions.
> Switching to simple lookup through getFields (that looks also to super 
> classes fields) _looks_ quicker (this of course would need to be thoroughly 
> tested)



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (SLING-8205) stop using Class.getField() to stop spitting out NoSuchFieldException

2019-01-09 Thread Nicolas Peltier (JIRA)


[ 
https://issues.apache.org/jira/browse/SLING-8205?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16737982#comment-16737982
 ] 

Nicolas Peltier commented on SLING-8205:


cc [~radu.cotescu] did some tests as follow: on a blank adobe experience 
manager 6.4 (using compiler 1.0.20-1.3.1) hit 1000 times the sample page 
/content/we-retail/us/en/men.html with apache benchmark and 10 concurrent users 
(which is {{ab -n 1000 -c 10 -A admin:admin 
http://localhost:4502/content/we-retail/us/en/men.html\?wcmmode\=disabled}}). 
1.13 M NoSuchFieldExceptions are spit. 0 with the fix i'll PR.
Moreover, the time taken (after "heating" the instance by running several times 
this test) i get 
With NSFE 
{Code}
Server Hostname:localhost
Server Port:4502

Document Path:  /content/we-retail/us/en/men.html?wcmmode=disabled
Document Length:65759 bytes

Concurrency Level:  10
Time taken for tests:   28.536 seconds
Complete requests:  1000
Failed requests:0
Total transferred:  65887000 bytes
HTML transferred:   65759000 bytes
Requests per second:35.04 [#/sec] (mean)
Time per request:   285.360 [ms] (mean)
Time per request:   28.536 [ms] (mean, across all concurrent requests)
Transfer rate:  2254.79 [Kbytes/sec] received

Connection Times (ms)
  min  mean[+/-sd] median   max
Connect:00   0.1  0   1
Processing:   117  283  45.5277 573
Waiting:  106  262  42.7256 553
Total:117  284  45.5277 573

Percentage of the requests served within a certain time (ms)
  50%277
  66%295
  75%306
  80%317
  90%342
  95%367
  98%394
  99%417
 100%573 (longest request)
{Code}
and without:
{Code}
Server Hostname:localhost
Server Port:4502

Document Path:  /content/we-retail/us/en/men.html?wcmmode=disabled
Document Length:65759 bytes

Concurrency Level:  10
Time taken for tests:   21.382 seconds
Complete requests:  1000
Failed requests:0
Total transferred:  65887000 bytes
HTML transferred:   65759000 bytes
Requests per second:46.77 [#/sec] (mean)
Time per request:   213.825 [ms] (mean)
Time per request:   21.382 [ms] (mean, across all concurrent requests)
Transfer rate:  3009.14 [Kbytes/sec] received

Connection Times (ms)
  min  mean[+/-sd] median   max
Connect:00   0.1  0   3
Processing:   101  212  37.4206 438
Waiting:   86  188  33.8182 407
Total:101  212  37.4206 438

Percentage of the requests served within a certain time (ms)
  50%206
  66%223
  75%235
  80%242
  90%262
  95%279
  98%298
  99%338
 100%438 (longest request)
{Code}

> stop using Class.getField() to stop spitting out NoSuchFieldException
> -
>
> Key: SLING-8205
> URL: https://issues.apache.org/jira/browse/SLING-8205
> Project: Sling
>  Issue Type: Improvement
>  Components: Scripting
>Reporter: Nicolas Peltier
>Assignee: Nicolas Peltier
>Priority: Major
>
> According to java mission control, exceptions are bad for performances, and 
> o.a.s.scripting.sightly.compiler.util.ObjectModel uses Class.getField first 
> to check if a use member is a simple field or a method, which generates 
> *lots* of exceptions.
> Switching to simple lookup through getFields (that looks also to super 
> classes fields) _looks_ quicker (this of course would need to be thoroughly 
> tested)



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)