I didn't get an answer to my question in another site and so I posted it, again.
I'm compiling a native code using cygwin in Windows7.
I got many optimization tips and applied them into my code.
But, I don't think that the optimization is applied into my native code.
I can't figure out why the optimization doesn't work. (Particularly, APP_OPTIM := release)
Application.mk
APP_PROJECT_PATH := $(shell pwd)
APP_MODULES := native_lib
APP_OPTIM := release
APP_BUILD_SCRIPT := Android.mk
APP_ABI := armeabiAndroid.mk
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := crypto
LOCAL_SRC_FILES := lib/libcrypto.so
include $(PREBUILT_SHARED_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := native_lib
LOCAL_SRC_FILES := nativeC.c \
AES/main.c \
AES/aes.c
LOCAL_C_INCLUDES := ./lib
LOCAL_SHARED_LIBRARIES := crypto
LOCAL_CFLAGS += -O2
LOCAL_CFLAGS += -DNDEBUG
LOCAL_CFLAGS += -march=armv6 -marm -mfloat-abi=softfp -mfpu=vfp
LOCAL_LDLIBS += -ldl
include $(BUILD_SHARED_LIBRARY)I hope many comments.
In Addition, why I think my code is not optimized is as follows.
First, I tried to compare the cases between with the above flag and without it. (e.g. I compiled my program with APP_OPTIM := release in Application.mk, and then I compiled without it or with APP_OPTIM := debug, again.) But, I cannot see any change of the running speed.
Second, this is the most important, My program compare the speed of two modules. (For convenience, I call them module A, B) Module A is prebuilt (which is libcrypto.so in Android.mk). And I want to apply optimization into Module B. First of all, I compared the speed test of module A and B in PC (Visual Studio 2010). When I tried module A and B in the PC, the module B is faster than A. (Of course, I precompiled the module A and I use it by calling the library.) Now I'm porting the my program for PC into it for Android. But in Android, the module B is too slower than A.
Therefore, I concluded that this is not optimized.
In summary,
Do you think what my program's problem is ? Thank you in advance.
My PC's CPU is "Intel COre 2 Quad Q6600", while the phone's CPU is "ARMv7 Processor rev 1 (v7l)".