HowTo Speed up ThinkorSwim Chart Loading time Or any Java platform

Discussion in 'Trading Software' started by tlow, Jan 27, 2011.

Did this work for you with your platfrom?

  1. ThinkorSwim YES!

    3 vote(s)
    75.0%
  2. ThinkorSwim NO :(

    0 vote(s)
    0.0%
  3. Interactive Brokers Yes!

    0 vote(s)
    0.0%
  4. Interactive Brokers NO :(

    0 vote(s)
    0.0%
  5. Other Java Platform YES!

    1 vote(s)
    25.0%
  6. Other Java Platfrom NO :(

    0 vote(s)
    0.0%
  1. tlow

    tlow

    So this guide is intended for Linux users, ubuntu in particular. For you Windoze users, I haven't tried it on the various OS. If I get time I will try it out and see if i can make a how to for you.

    Caution: I have no idea if this is going to break your graphics and/or your Operating system. Do this at your own risk know the consequences...make sure you have everything backed up before proceeding. Also, I am not an expert by any means. If you have a question, I will do my best to help, but maybe some of the Java/programmers/computer geeks can chime in as well to help out.

    Other Notes: The basis of this howto is using the OpenGL driver for your graphics card. I will show some basic steps, but you need to find out 1.) if you graphics card can support it and 2.) if it can be enabled on your operating system...that is beyond the scope of this tutorial (and somewhat beyond me). Google is your friend.

    This should work for any Java based platform. I did it on Thinkorswim since that is what I run and noticed a huge difference...especially in the load speed of the charts. Im guessing it should work for you IB TWS users or any java platform for that matter.

    I ran this on a Dell E6400 with Intel GMA4500 HMD integrated graphics with Ubuntu Lucid installed.

    I cannot take any credit for this other than writing it up...I found the majority of the information here:
    http://ubuntuforums.org/showthread.php?t=1129187

    So lets get started:

    First,
    lets make sure your graphics are running ok.

    Open a terminal and type:

    glxgears

    (Hit CTRL-C to stop or just close the window)

    If you have a newer chipset, say a core duo and up, you should be seeing over 1000 per 5 secs (Im not expert just a guestimate based on what I've seen on the net). If your not, you most likely need a new/updated/different driver. Again, beyond the scope but google it and ask questions. I see around 2500 with my system. If you have a high end graphics card, you are probably anywhere from 4000-8000.

    Next,
    let's make sure OpenGL is installed and working...again,in the terminal type:

    glxinfo | grep render

    You should see something along the lines of:

    direct rendering: Yes
    OpenGL renderer string: Mesa DRI Mobile Intel® GM45 Express Chipset GEM 20091221

    If you do not see something like this...same deal, probably need a new/updated/different driver with OpenGL AND/OR you need to see if you system can even support OpenGL.

    Next,
    You need to find the folder where the start-up shell script is stored. For thinkorswim on my system, the file is called "thinkorswim" and its in home=>thinkorswim=>thinkorswim. If you can't find it, do a system wide search for thinkorswim...you are then looking for the file type to be a shell script.
    Now that you've found it, we need to go to that directory and edit that file...type in the terminal:

    cd /thinkorswim/thinkorswim (or to wherever your start-up shell script is located)

    then,

    sudo gedit thinkorswim

    Next,
    You should have the thinkorswim file open in a text editor with a whole bunch of programming mumbo jumbo. Scroll down towards the bottom and find a line that looks like:

    INSTALL4J_ADD_VM_PARAMS="$INSTALL4J_ADD_VM_PARAMS $vmoptions_val"

    If there is a # in front of this line, delete the # only.

    Next,
    We need to add some stuff to the script...right below where it has INSTALL4J_ADD_VM_PARAMS="$INSTALL4J_ADD_VM_PARAMS $vmoptions_val", there should be another set of lines that contains something along the lines of:

    "$app_java_home/bin/java" -Dinstall4j.jvmDir="$app_java_home" -Dexe4j.moduleName="$prg_dir/$progname" $INSTALL4J_ADD_VM_PARAMS -classpath "$local_classpath" com.install4j.runtime.Launcher launch com.devexperts.jnlp.Launcher true false "$prg_dir/client.out" "$prg_dir/client.out" true true false "" true true 470 265 "" 20 20 "Arial" "0,0,0" 8 500 "" 20 40 "Arial" "0,0,0" 8 500 -1 "$@"

    In this set of lines we need to add the following:
    -Dsun.java2d.noddraw=true -Dsun.java2d.opengl=true -Dsun.java2d.d3d=false

    Here is how it looks on mine. Im not sure if its ok to move this set of commands around or what, but I put them as below and it seems to work:

    "$app_java_home/bin/java" -Dinstall4j.jvmDir="$app_java_home" -Dexe4j.moduleName="$prg_dir/$progname" -Dsun.java2d.noddraw=true -Dsun.java2d.opengl=true -Dsun.java2d.d3d=false $INSTALL4J_ADD_VM_PARAMS -classpath "$local_classpath" com.install4j.runtime.Launcher launch com.devexperts.jnlp.Launcher true false "$prg_dir/client.out" "$prg_dir/client.out" true true false "" true true 470 265 "" 20 20 "Arial" "0,0,0" 8 500 "" 20 40 "Arial" "0,0,0" 8 500 -1 "$@"

    Note: For you guys running other Java Platforms such as IB TWS you want to look for something that has "VM_PARAMS" or "VM_Properties" or default_options...something along those lines is where you need to stick the extra code.

    Here is the java site for some reference:
    http://download.oracle.com/javase/1.5.0/docs/guide/2d/flags.html

    Now,

    Save and close your file. Then reopen Thinkorswim...it should load about the same speed, but then go over to your charts and you should see a dramatically faster load time.

    Thats it. Hope this helps someone. As I said, I will do my best to answer questions and work on a windows howto (if it will work at all)
     
  2. tlow

    tlow

    Ok so for all you windows users here it is...pretty simple actually:

    I learned that OpenGL gets installed automatically with your graphics driver so almost all of you should already have it installed. This should work for any windows OS both in 32-bit and 64-bit. Here is the wiki if you're curious:
    http://www.opengl.org/wiki/Getting_started

    So since you have it installed, lets check anyway:

    Go here and download the GPU checker:

    http://www.geeks3d.com/20110125/gpu-tool-gpu-caps-viewer-1-9-6-released-with-gtx-560-ti-support/

    Go ahead and download and install it. Then up on the top where the tabs are located, you should see "OpenGL", Click on that tab and it should show you what version you have installed, your chipset, blah, blah, blah.

    If you see nothing in the fields, then its not installed. Either your graphics doesn't support it or you need to figure out why its not installed, again, beyond the scope of this howto.

    Now that we know we have OpenGL installed, lets modify the file.

    Windows7 and Vista users it requies a bit more work (nothing major) to get around user/admin permissions.


    First,

    Open up "My computer" or "Explorer", then click on the C: drive (or your main drive), then Program Files, then ThinkorSwim.

    Next, if you scoll down there should be a couple files called "Thinkorswim"...one is the main exectuable file (the one with the familiar icon) and the other is the script file we need to edit.
    Right click on the scipt file called Thinkorswim.vmoptions...then select "Open With..."
    Another screen will pop up and select Notepad. You should then see Notepad open up with the following written:

    -Xmx512m
    -Xms32m
    -Dsun.java2d.noddraw=true
    -classpath launcher.jar
    -Dawt.useSystemAAFontSettings=false
    -Dsun.awt.disableMixing=true


    At the bottom of that add in:

    -Dsun.java2d.opengl=true
    -Dsun.java2d.d3d=false

    (Note if you dont have the line "-Dsun.java2d.noddraw=true" add that in as well)

    Now, windows XP and below can just save and close (you are done)...if you are on Windows Vista or 7, Go up to The File Menu, hit Save as...Save the file as "thinkorswim.vmoptions" then save it to your desktop or somewhere else easy to get to.

    Next, go back to my computer or explorer and make sure you are still in the same C:=>ProgramFiles=>ThinkorSwim directory. Simply drag and drop the file you just saved into that folder. Windows will ask you if you want to replace and hit yes.

    For whatever reason, if it won't let you save it...try deleting the original file out of the program files folder first and then drag and drop the new one. One other note, if it doesn't override the other file, your naming is probably wrong. If you right click on your modified file and hit "properties"...check the name...if it reads, "thinkorswim.vmoptions.vmoptions", just rename and delete that last".vmoptions"

    Now, go open your ThinkorSwim desktop and should see some nice improved speed on the charts. On my computer, it used to take 1-3 seconds to load, now I blink and its loaded.

    Not too bad.

    For everyone else running a Java based platfrom, same steps apply but you need to find where your java options/properties script is located and edit that file...should be pretty similar extension of .vmoptions. Remeber add in the following 3 lines at the bottom of the file:
    -Dsun.java2d.opengl=true
    -Dsun.java2d.d3d=false
    -Dsun.java2d.noddraw=true
     
  3. So this probably doesn't make any sense but I followed your steps for think or swim and when I started the program the colors were weird and it wasn't working properly.

    So, I went back into the file and just simply deleted the 2 lines of code i added and resaved the file.

    BUT, now its really fast at loading charts?!?!?!?
     
  4. tlow

    tlow

    hmmm,

    First off, is this a windows machine?

    So if you restart windows all together and then go to the script file and reopen it, are the lines still deleted or have they reappeared?

    Kinda weird the colors got screwed up, maybe has something to do with the rendering? I have no idea.

    Do you have any additional lines other than ones I showed in the example of my file?
     
  5. windows xp

    the lines in the file matched exactly how you listed them but I also just noticed that when i saved the file .vmoptions part of the file name is no longer there, now its just called "thinkorswim"

    but ill try restarting and see what the lines of code look like.

    edit: nope, the code in the file is back to the original.
     
  6. Anyone know how to speed up chart loading times on a Mac? I've played around with several of these suggestions but nothing seems to help.

    I'm on a Retina 5K 27" iMac 17,1 running 10.11.6 El Capitan... 3.2 GHz Core i5, 8GB RAM with an AMD Radeon R9 M390 graphics card with 2GB VRAM.

    Thanks in advance for any suggestions you can offer!
     
  7. GouZi

    GouZi

  8. ken__0

    ken__0

    The stuff your talking about seems scary I Sign in to tos and it loads . Im just amazed yesterday i signed in and had a nasdaq fulbook/bats edge option on level 2,
    If you could change the look and feel of this thing it would be neat .