https://github.com/bep/sandbox
Sandbox for testing out different things.
https://github.com/bep/sandbox
Last synced: about 1 year ago
JSON representation
Sandbox for testing out different things.
- Host: GitHub
- URL: https://github.com/bep/sandbox
- Owner: bep
- Created: 2011-08-23T09:15:49.000Z (over 14 years ago)
- Default Branch: master
- Last Pushed: 2011-08-25T13:21:32.000Z (over 14 years ago)
- Last Synced: 2025-02-13T14:41:05.312Z (about 1 year ago)
- Language: Groovy
- Homepage:
- Size: 270 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Bep's sandbox
=============
This is a sandbox.
The stuff hidden here should work, it should contain some interesting stuff - but it is a sandbox, and as so should be considered experimental.
/grails
-------
### /collection-or-not
This is a small Grails project to test out GORM modelling (Hibernate) one-to-many-realationships (also applies to many-to-many) with and without use of Collection on the 1 side (defaults to java.util.Set in Grails).
The code is inspired by this blog post: https://mrpaulwoods.wordpress.com/2011/02/07/implementing-burt-beckwiths-gorm-performance-no-collections/
On my i7 Ubuntu desktop with 6 gigs (heap size set to default, though) of ram and the citizen number set to 10000:
00438 001% Creating Japan With Collection
16928 037% Adding the first 10000 citizens to Japan With Collection
11202 025% Adding one more citizen to Japan With Collection
00050 000% Creating Japan Without Collection
15901 035% Adding the first 10000 citizens to Japan Without Collection
00061 000% Adding one more citizen to Japan Without Collection
00844 002% Deleting Japan With Collection
00164 000% Deleting Japan Without Collection
The interesting line is the "Adding one more ...". I also question the cascade-deletion algorithm used for the hasMany-country. Will look into that one.
To run the tests:
*grails test-app integration: -echoOut*