blob: 20ca6bc2d83f2d5bc37de29ea6ace0fac5030502 [file] [log] [blame]
<!--
/***************************************************************************************************************************
* Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
***************************************************************************************************************************/
-->
Best Practices
<ol class='spaced-list'>
<li>
Reuse instances of serializers and parsers whenever possible.
<br>They are designed to be thread safe and maintain internal caches of bean metadata to increase performance.
<li>
The {@link oaj.BeanTraverseContext#BEANTRAVERSE_detectRecursions BEANTRAVERSE_detectRecursions}
option on the {@link oaj.serializer.Serializer} class can cause a performance penalty of
around 20%.
<br>Therefore, it's recommended that this option be used only when necessary.
<li>
In general, JSON serialization and parsing is about 20% faster than XML.
JSON is also more compact than XML.
<br>MessagePack is fastest and most compact of all.
<li>
The RDF parsers are SLOW.
<br>RDF simply isn't efficient with node traversal, so creating tree structures out of RDF models
is highly inefficient.
<li>
The {@link oaj.parser.Parser} methods that take in {@link oaj.ClassMeta}
parameters are slightly faster than methods that
take in {@link java.lang.Class} or {@link java.lang.Object} parameters, since the latter methods involve
hash lookups to resolve to {@link oaj.ClassMeta} parameters.
</ol>