Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Grails 2.3.3 upgrade and implementation for all test types #603

Merged
merged 33 commits into from
Nov 22, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
4b8439f
Upgrade app to Grails 2.3.0
lhotari Sep 29, 2013
3f79634
Exclude /hello & /hello/* urls from sitemesh processing
lhotari Sep 29, 2013
fc90ab7
Make OSIV readonly by default
lhotari Sep 29, 2013
6ad315e
Fix setup.py for Grails 2.3.0
lhotari Sep 29, 2013
628249f
Fix problem in mapping, Mysql mapping is case-sensitive
lhotari Sep 29, 2013
de4accf
use hibernate 3.6.10.2 plugin version
lhotari Oct 20, 2013
d0dce48
Upgrade to Grails 2.3.2.BUILD-SNAPSHOT , use @CompileStatic in contro…
lhotari Oct 20, 2013
c2fbb39
Wrap db reads in read only transaction
lhotari Oct 20, 2013
5eb6860
use Integer id instead of default Long id type
lhotari Nov 7, 2013
f801114
Add gitignore file for grails project
lhotari Nov 7, 2013
51a4b76
update STS/eclipse IDE files
lhotari Nov 7, 2013
adf007e
Optimize MySQL JDBC connection properties
lhotari Nov 7, 2013
679e9f5
Make it easier to profile the app with Yourkit Java Profiler (yjp)
lhotari Nov 7, 2013
95b4bc4
update dependencies
lhotari Nov 7, 2013
e6c8cee
use statement cache in Tomcat JDBC pool
lhotari Nov 7, 2013
00dc1ba
Get rid of unnecessary SQL exceptions thrown in Mysql jdbc driver
lhotari Nov 7, 2013
03cef00
Use custom JSON marshaller for World
lhotari Nov 7, 2013
1f33c48
Update tests to latest spec in http://www.techempower.com/benchmarks/…
lhotari Nov 7, 2013
d140b22
implement "Test type 4: Fortunes"
lhotari Nov 7, 2013
0ee87ec
Implement "Test type 5: Database updates"
lhotari Nov 7, 2013
feda5a7
configure hibernate batch updates
lhotari Nov 7, 2013
736b966
update benchmark_config
lhotari Nov 7, 2013
63ec107
maxActive = 512 in db pool config
lhotari Nov 7, 2013
296b709
do locking to prevent dead locks in updates test
lhotari Nov 7, 2013
cda7713
update to Grails 2.3.2
lhotari Nov 7, 2013
252286c
Add test urls to README
lhotari Nov 7, 2013
5e1af6c
Use same urls for development
lhotari Nov 7, 2013
976cccf
Prevent dead locks by locking all rows at once
lhotari Nov 7, 2013
fbde981
Adhere to test type #3 requirement 6
lhotari Nov 7, 2013
9b56a6a
Update to Grails 2.3.3 version
lhotari Nov 21, 2013
850892f
Don't skip grails benchmark
lhotari Nov 22, 2013
a05d373
use JSONWriter API for custom JSON marshaller
lhotari Nov 22, 2013
61e4a03
workaround for GRAILS-10823
lhotari Nov 22, 2013
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion config/benchmark_profile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk-amd64
export RESIN_HOME=~/FrameworkBenchmarks/installs/resin-4.0.36
export GRAILS_HOME=~/FrameworkBenchmarks/installs/grails-2.3.1
export GRAILS_HOME=~/FrameworkBenchmarks/installs/grails-2.3.3
export VERTX_HOME=~/FrameworkBenchmarks/installs/vert.x-2.0.2-final
export GOROOT=~/FrameworkBenchmarks/installs/go
export GOPATH=~/FrameworkBenchmarks/go:~/FrameworkBenchmarks/webgo:~/FrameworkBenchmarks/revel
Expand Down
25 changes: 21 additions & 4 deletions grails/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,34 @@ This is the Grails portion of a [benchmarking test suite](../) comparing a varie

## Infrastructure Software Versions
The tests were run with:
* [Grails 2.3.1](http://grails.org/)
* [Grails 2.3.3](http://grails.org/)
* [Java OpenJDK 1.7.0_09](http://openjdk.java.net/)
* [Resin 4.0.34](http://www.caucho.com/)
* [MySQL 5.5.29](https://dev.mysql.com/)


## Test URLs
### JSON Encoding Test

### Test type 1: JSON serialization

http://localhost:8080/grails/hello/json

### Data-Store/Database Mapping Test
### Test type 2: Single database query

http://localhost:8080/grails/hello/db

### Test type 3: Multiple database queries

http://localhost:8080/grails/hello/queries?queries=10

### Test type 4: Fortunes

http://localhost:8080/grails/hello/fortunes

### Test type 5: Database updates

http://localhost:8080/grails/hello/updates?queries=10

### Test type 6: Plaintext

http://localhost:8080/grails/hello/db?queries=5
http://localhost:8080/grails/hello/plaintext
8 changes: 5 additions & 3 deletions grails/benchmark_config
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@
"setup_file": "setup",
"json_url": "/grails/hello/json",
"db_url": "/grails/hello/db",
"query_url": "/grails/hello/db?queries=",
"query_url": "/grails/hello/queries?queries=",
"fortune_url": "/grails/hello/fortunes",
"update_url": "/grails/hello/updates?queries=",
"plaintext_url": "/grails/hello/plaintext",
"port": 8080,
"approach": "Realistic",
"classification": "Fullstack",
Expand All @@ -19,8 +22,7 @@
"database_os": "Linux",
"display_name": "grails",
"notes": "",
"versus": "servlet",
"skip": "true"
"versus": "servlet"
}
}]
}
28 changes: 15 additions & 13 deletions grails/hello/.classpath
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src/java"/>
<classpathentry kind="src" path="src/groovy"/>
<classpathentry kind="src" path="grails-app/conf"/>
<classpathentry kind="src" path="grails-app/controllers"/>
<classpathentry kind="src" path="grails-app/domain"/>
<classpathentry kind="src" path="grails-app/services"/>
<classpathentry kind="src" path="grails-app/taglib"/>
<classpathentry kind="src" path="test/integration"/>
<classpathentry kind="src" path="test/unit"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="com.springsource.sts.grails.core.CLASSPATH_CONTAINER"/>
<classpathentry kind="output" path="web-app/WEB-INF/classes"/>
</classpath>
<classpathentry kind="src" path="src/java"/>
<classpathentry kind="src" path="src/groovy"/>
<classpathentry kind="src" path="grails-app/conf"/>
<classpathentry kind="src" path="grails-app/controllers"/>
<classpathentry kind="src" path="grails-app/domain"/>
<classpathentry kind="src" path="grails-app/services"/>
<classpathentry kind="src" path="grails-app/taglib"/>
<classpathentry kind="src" path="grails-app/utils"/>
<classpathentry kind="src" path="test/integration"/>
<classpathentry kind="src" path="test/unit"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.grails.ide.eclipse.core.CLASSPATH_CONTAINER"/>
<classpathentry kind="output" path="target-eclipse/classes"/>
</classpath>
17 changes: 17 additions & 0 deletions grails/hello/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
*.iws
*Db.properties
*Db.script
.settings
stacktrace.log
/*.zip
/plugin.xml
/*.log
/*DB.*
/cobertura.ser
.DS_Store
/target/
/out/
/web-app/plugins
/web-app/WEB-INF/classes
/.link_to_grails_plugins/
/target-eclipse/
8 changes: 7 additions & 1 deletion grails/hello/.project
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,21 @@
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.wst.common.project.facet.core.builder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>com.springsource.sts.grails.core.nature</nature>
<nature>org.grails.ide.eclipse.core.nature</nature>
<nature>org.eclipse.jdt.groovy.core.groovyNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
</natures>
</projectDescription>
4 changes: 2 additions & 2 deletions grails/hello/application.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Grails Metadata file
#Sat Oct 26 13:32:20 PDT 2013
app.grails.version=2.3.1
#Sun Oct 20 22:08:59 EEST 2013
app.grails.version=2.3.3
app.name=hello
app.servlet.version=2.5
app.version=0.1
37 changes: 32 additions & 5 deletions grails/hello/grails-app/conf/BuildConfig.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,34 @@ grails.servlet.version = "2.5" // Change depending on target container complianc
grails.project.class.dir = "target/classes"
grails.project.test.class.dir = "target/test-classes"
grails.project.test.reports.dir = "target/test-reports"
grails.project.work.dir = "target/work"
grails.project.target.level = 1.7
grails.project.source.level = 1.7
//grails.project.war.file = "target/${appName}-${appVersion}.war"

grails.project.fork = [
// configure settings for compilation JVM, note that if you alter the Groovy version forked compilation is required
// compile: [maxMemory: 256, minMemory: 64, debug: false, maxPerm: 256, daemon:true],

// configure settings for the test-app JVM, uses the daemon by default
test: [maxMemory: 768, minMemory: 64, debug: false, maxPerm: 256, daemon:true],
// configure settings for the run-app JVM
run: [maxMemory: 768, minMemory: 64, debug: false, maxPerm: 256, forkReserve:false],
// configure settings for the run-war JVM
war: [maxMemory: 768, minMemory: 64, debug: false, maxPerm: 256, forkReserve:false],
// configure settings for the Console UI JVM
console: [maxMemory: 768, minMemory: 64, debug: false, maxPerm: 256]
]

def yjpConfig = [jvmArgs: [
"-agentpath:/opt/yjp/bin/linux-x86-64/libyjpagent.so=delay=30000,disablealloc,disablej2ee,noj2ee,builtinprobes=none,sampling,monitors,onexit=snapshot,telemetryperiod=250"
]]
if (System.getProperty("grails.yjp")) {
grails.project.fork.war += yjpConfig
println "Using YJP for run-war"
}

grails.project.dependency.resolver = "maven" // or ivy
grails.project.dependency.resolution = {
// inherit Grails' default dependencies
inherits("global") {
Expand All @@ -14,11 +38,13 @@ grails.project.dependency.resolution = {
}
log "error" // log level of Ivy resolver, either 'error', 'warn', 'info', 'debug' or 'verbose'
checksums true // Whether to verify checksums on resolve
legacyResolve false // whether to do a secondary resolve on plugin installation, not advised and here for backwards compatibility

repositories {
inherits true // Whether to inherit repository definitions from plugins
grailsPlugins()
grailsHome()
mavenLocal()
grailsCentral()
mavenCentral()

Expand All @@ -33,18 +59,19 @@ grails.project.dependency.resolution = {
dependencies {
// specify dependencies here under either 'build', 'compile', 'runtime', 'test' or 'provided' scopes eg.

runtime 'mysql:mysql-connector-java:5.1.22'
runtime 'mysql:mysql-connector-java:5.1.27'
}

plugins {
compile ":hibernate:3.6.10.2"
runtime ":jquery:1.7.1"
runtime ":resources:1.1.6"
runtime ":hibernate:3.6.10.4"
//runtime ":jquery:1.10.2"
//runtime ":resources:1.2.1"

// Uncomment these (or add new ones) to enable additional resources capabilities
//runtime ":zipped-resources:1.0"
//runtime ":cached-resources:1.0"
//runtime ":yui-minify-resources:0.1.4"
build ':tomcat:7.0.40.1'

build ":tomcat:7.0.47"
}
}
91 changes: 49 additions & 42 deletions grails/hello/grails-app/conf/Config.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -12,32 +12,60 @@


grails.project.groupId = appName // change this to alter the default package name and Maven publishing destination
grails.mime.file.extensions = true // enables the parsing of file extensions from URLs into the request format
grails.mime.use.accept.header = false
grails.mime.types = [ html: ['text/html','application/xhtml+xml'],
xml: ['text/xml', 'application/xml'],
text: 'text/plain',
js: 'text/javascript',
rss: 'application/rss+xml',
atom: 'application/atom+xml',
css: 'text/css',
csv: 'text/csv',
all: '*/*',
json: ['application/json','text/json'],
form: 'application/x-www-form-urlencoded',
multipartForm: 'multipart/form-data'
]

grails.app.context = '/grails'

// The ACCEPT header will not be used for content negotiation for user agents containing the following strings (defaults to the 4 major rendering engines)
grails.mime.disable.accept.header.userAgents = ['Gecko', 'WebKit', 'Presto', 'Trident']
grails.mime.types = [
all: '*/*',
atom: 'application/atom+xml',
css: 'text/css',
csv: 'text/csv',
form: 'application/x-www-form-urlencoded',
html: ['text/html','application/xhtml+xml'],
js: 'text/javascript',
json: ['application/json', 'text/json'],
multipartForm: 'multipart/form-data',
rss: 'application/rss+xml',
text: 'text/plain',
hal: ['application/hal+json','application/hal+xml'],
xml: ['text/xml', 'application/xml']
]

// URL Mapping Cache Max Size, defaults to 5000
//grails.urlmapping.cache.maxsize = 1000

// What URL patterns should be processed by the resources plugin
grails.resources.adhoc.patterns = ['/images/*', '/css/*', '/js/*', '/plugins/*']

// Legacy setting for codec used to encode data with ${}
grails.views.default.codec = "html"

// The default scope for controllers. May be prototype, session or singleton.
// If unspecified, controllers are prototype scoped.
grails.controllers.defaultScope = 'singleton'

// The default codec used to encode data with ${}
grails.views.default.codec = "none" // none, html, base64
grails.views.gsp.encoding = "UTF-8"
// GSP settings
grails {
views {
gsp {
encoding = 'UTF-8'
htmlcodec = 'xml' // use xml escaping instead of HTML4 escaping
codecs {
expression = 'html' // escapes values inside ${}
scriptlet = 'html' // escapes output from scriptlets in GSPs
taglib = 'none' // escapes output from taglibs
staticparts = 'none' // escapes output from static template parts
}
}
// escapes all not-encoded output at final stage of outputting
filteringCodecForContentType {
//'text/html' = 'html'
}
}
}

grails.converters.encoding = "UTF-8"
// enable Sitemesh preprocessing of GSP pages
grails.views.gsp.sitemesh.preprocess = true
Expand All @@ -59,6 +87,9 @@ grails.exceptionresolver.params.exclude = ['password']
// disabling query cache
grails.hibernate.cache.queries = false

// OSIV is readonly by default
grails.hibernate.osiv.readonly = true

// set per-environment serverURL stem for creating absolute links
environments {
development {
Expand Down Expand Up @@ -91,27 +122,3 @@ log4j = {
'org.hibernate',
'net.sf.ehcache.hibernate'
}

// Uncomment and edit the following lines to start using Grails encoding & escaping improvements

/* remove this line
// GSP settings
grails {
views {
gsp {
encoding = 'UTF-8'
htmlcodec = 'xml' // use xml escaping instead of HTML4 escaping
codecs {
expression = 'html' // escapes values inside null
scriptlet = 'none' // escapes output from scriptlets in GSPs
taglib = 'none' // escapes output from taglibs
staticparts = 'none' // escapes output from static template parts
}
}
// escapes all not-encoded output at final stage of outputting
filteringCodecForContentType {
//'text/html' = 'html'
}
}
}
remove this line */
34 changes: 31 additions & 3 deletions grails/hello/grails-app/conf/DataSource.groovy
Original file line number Diff line number Diff line change
@@ -1,25 +1,53 @@
import org.springframework.beans.factory.config.PropertiesFactoryBean
import org.springframework.core.io.support.ResourceArrayPropertyEditor

dataSource {
pooled = true
dbCreate = "update"
url = "jdbc:mysql://localhost:3306/hello_world?jdbcCompliantTruncation=false&elideSetAutoCommits=true&useLocalSessionState=true&cachePrepStmts=true&cacheCallableStmts=true&alwaysSendSetIsolation=false&prepStmtCacheSize=4096&cacheServerConfiguration=true&prepStmtCacheSqlLimit=2048&zeroDateTimeBehavior=convertToNull&traceProtocol=false&useUnbufferedInput=false&useReadAheadInput=false&maintainTimeStats=false&useServerPrepStmts&cacheRSMetadata=true"
url = "jdbc:mysql://localhost:3306/hello_world"
driverClassName = "com.mysql.jdbc.Driver"
dialect = org.hibernate.dialect.MySQL5InnoDBDialect
username = "benchmarkdbuser"
password = "benchmarkdbpass"
properties {
maxActive = 256
fairQueue = false
maxActive = 512
maxIdle = 25
minIdle = 5
initialSize = 5
minEvictableIdleTimeMillis = 60000
timeBetweenEvictionRunsMillis = 60000
maxWait = 10000
validationQuery = "/* ping */"
maxAge = 1800 * 1000
numTestsPerEvictionRun=3
testOnBorrow=false
testWhileIdle=true
testOnReturn=false
validationQuery="/* ping */"
validationInterval=15000
jdbcInterceptors="ConnectionState;StatementCache"
defaultTransactionIsolation = java.sql.Connection.TRANSACTION_READ_UNCOMMITTED
dbProperties = this.loadProperties("classpath:mysql-connection.properties")
}
}

hibernate {
// Purposely turning off query cache
cache.use_second_level_cache = false
cache.use_query_cache = false
cache.region.factory_class = 'net.sf.ehcache.hibernate.EhCacheRegionFactory'
default_batch_fetch_size=256
jdbc.fetch_size=256
jdbc.batch_size=500
}

static Properties loadProperties(String path) {
PropertiesFactoryBean pfb=new PropertiesFactoryBean()
pfb.setIgnoreResourceNotFound(true)
def converter=new ResourceArrayPropertyEditor()
converter.setAsText(path)
pfb.setLocations(converter.getValue())
pfb.afterPropertiesSet()
return pfb.object
}

Loading