[tor-bugs] #13574 [Onionoo]: Tweak memory usage of hourly cronjob
Tor Bug Tracker & Wiki
blackhole at torproject.org
Tue Oct 28 21:57:08 UTC 2014
#13574: Tweak memory usage of hourly cronjob
-----------------------------+--------------------------
Reporter: karsten | Owner:
Type: enhancement | Status: needs_review
Priority: normal | Milestone:
Component: Onionoo | Version:
Resolution: | Keywords:
Actual Points: | Parent ID:
Points: |
-----------------------------+--------------------------
Comment (by iwakeh):
Didn't have time for testing, but switching from commons-lang to commons-
lang3 might be a good choice in addition to your patch.
The switch to commons-lang3 ([https://commons.apache.org/proper/commons-
lang/article3_0.html lang3 changes]) contained a complete rewrite of
'StringEscapeUtils'. And, I remember that I saw some good effect on using
less 'String's during runtime in a former project.
Code changes would only be the import statements
{{{
-import org.apache.commons.lang.StringEscapeUtils;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringEscapeUtils;
+import org.apache.commons.lang3.StringUtils;
}}}
classpath
{{{
- <include name="commons-lang-2.6.jar"/>
+ <include name="commons-lang3-3.1.jar"/>
}}}
and
{{{
- return StringUtils.replaceEach(StringEscapeUtils.escapeJavaScript(s),
+ return StringUtils.replaceEach(StringEscapeUtils.escapeEcmaScript(s),
}}}
as well as the corresponding unescapes (and the addition of the debian
package).
Might be worth a try?
commons-lang is only used for un/escaping.
--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/13574#comment:5>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
More information about the tor-bugs
mailing list