Search This Blog

Wednesday, August 24, 2011

C++ High Resolution Timer

i used to get timing via GetTickCount API , but the smallest measurement i managed to get was about ~15 ms.
so if you need to measure elapsed time in micro seconds , the next article is for you
High Resolution Timer:


LARGE_INTEGER frequency;        // ticks per second
    LARGE_INTEGER t1, t2;           // ticks
    double elapsedTime;

    // get ticks per second
    QueryPerformanceFrequency(&frequency);

    // start timer
    QueryPerformanceCounter(&t1);

    // do something
    ...

    // stop timer
    QueryPerformanceCounter(&t2);

    // compute and print the elapsed time in millisec
    elapsedTime = (t2.QuadPart - t1.QuadPart) * 1000.0 / frequency.QuadPart;
    cout << elapsedTime << " ms.\n";

Visual Leak Detector - Memory Leak Detection for Visual C++

Visual Leak Detector - Enhanced Memory Leak Detection for Visual C++ - CodeProject

newer version for this tool could be found here Visual Leak Detector for Visual C++ 2008/2010

I didn't play with it yet, but good to know especially for Visual c++ 6 (its old and no more tools left).

Yaniv T


Monday, August 22, 2011

Visual C++ 6.0 - Developing Optimized Code

what a good article , its alwyes good to remember what you already forgot , the next link describe
how the Visual C++ compiler can optimize source code for speed and size and examines the reasons why code size matters. We have gone over the code generation and optimization switches and pragmas supported by Visual C++, how to choose the best switches for your project, and why and how to override them at the function level.

Developing Optimized Code with Microsoft Visual C++ 6.0
Profiling Your Application
C++ Optimization Strategies and Techniques



must for Visual c++ 6 developers ( yes i know its old .... )

Yaniv Tzanany

Sunday, August 21, 2011

memcached - distributed memory db

memcached is a high-performance, distributed memory object caching system, generic in nature, but intended for use in speeding up dynamic web applications by alleviating database load.

Free & open source, high-performance, distributed memory object caching system, generic in nature, but intended for use in speeding up dynamic web applications by alleviating database load.

Memcached is an in-memory key-value store for small chunks of arbitrary data (strings, objects) from results of database calls, API calls, or page rendering.

Memcached is simple yet powerful. Its simple design promotes quick deployment, ease of development, and solves many problems facing large data caches. Its APIis available for most popular languages.

Memcached is in used with the largest sites on earth , so its definitely worth a try , i really hope to test it ASAP.

YanivTzanany

Open Source used by Facebook Developers

study from the experts, what kind of open source are in used via Facebook.

Open Source - Facebook Developers

somehow i got a feeling that such open sources will continue to live longer than other.

Yaniv Tzanany

How to Speed Up Your Javascript or page Load Time

i enjoyed to read the next article
Speed Up Your Javascript Load Time | BetterExplained

Optimizing Page Load Time

Tuesday, August 2, 2011

Eclipse and C/C++

I downloaded the CDT from eclipse site , download cygwin, add some development packages as g++ / gcc / make.

you have two option:
add the bin directory into the path (C:\cygwin\bin).
or goto -> windows->prefrences->c/c++ -> build->environment click add .
 set varibale name to PATH and the VALUE to C:\cygwin\bin, make sure the "Append variable to native" is checked.

Configure the GDB:
Go to Windows->Preference->C/C++ -> Debug -> Common Source Lookup. add following 'Path mapping'.
  • \cygdrive\c -> c:\
 in case you get error like
 "Program not Binary" error while trying to debug  while running your compile program


Go to the project property choose
Make project --> and in the tab Binary Parser
choose :
"Cygwin PE binary parser"

Another option is to use the Mingw, install it with the msys ,

goto -> windows->prefrences->c/c++ -> build->environment click add .
 set varibale name to PATH and the VALUE to C:\mingw\bin;C:\MinGW\msys\1.0\bin, make sure the "Append variable to native" is checked.


some usefull links that can help you developing c++ application via Eclipse IDE:
Setting up Eclipse CDT on Windows, Linux/Unix, Mac OS X

  Setup Cygwin toolchain in Eclipse CDT

Developing applications using the Eclipse C/C++ Development Toolkit

Integrated Development Environment: C/C++ development with the Eclipse Platform


i am sure there are many article even better than the above i mentioned , but i used the above ...

Yaniv Tzanany

Monday, August 1, 2011

Visual C++ 6.0 : Precompiled headers

good article tha twill help you to increase compile time.

Fractal eXtreme: Precompiled headers

Solving memory problems in WebSphere applications

Learn how to identify root causes for and solve memory problems in WebSphere® Commerce during system test.
Solving memory problems in WebSphere applications

Websphere Max memory allocation for JVM

When you set the max memory size on websphere  7 installed on 32 bit machine – you will get the next warning:

 You have set the Maximum heap size field to a value greater than 2 gigabytes. This is only valid on a 64 bit server. You can ignore this warning if the server will run in 64 bit mode; otherwise, the maximum value is 2048.

The server failed to startup on 32 bit machine when I set  the max memory to 2200 (M).
in the startServer.log - you can find such logging:

ADMU7704E: Failed while trying to start the Windows Service associated with server: server1;
probable error executing WASService.exe: Starting Service: YANIVTNode01
Service failed to start.  startServer return code = -1



I test it on 64bit server , I set the max memory to 2500 , and the server startup successfully.
Summary:
If we want more than 2G RAM allocation for websphere on windows  , you must used 64Bit server.

enjoy 
Yaniv Tzanany