Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

org.jredis.ri.alphazero.support.Convert is way, way, way to slow. #29

Closed
antis0c opened this issue Sep 1, 2010 · 4 comments
Closed

Comments

@antis0c
Copy link

antis0c commented Sep 1, 2010

Awesome I hit save by mistake.. one sec real report incoming =)

@antis0c
Copy link
Author

antis0c commented Sep 1, 2010

I'm developing an Android application that utilizes JRedis, and noticed that connecting to a Redis server can take almost a minute depending on the speed of the device.

            ConnectionSpec spec = DefaultConnectionSpec.newSpec("xxxx", 6379, 3, new String("xxxx").getBytes());
            JRedis client = new JRedisClient(spec);

So I did a trace on these calls and found that the repeated iterations in Convert (both in the static initializer) and resulting methods were each taking over 30 seconds (when profiled).

static {
    for(int i=0; i<INT_P_65535; i++) Integer.toString(i).getBytes();
}

Is particularly bad..

@antis0c
Copy link
Author

antis0c commented Sep 1, 2010

I'm checking the code out now, I understand why you're doing what you're doing - but it comes at an unacceptable performance hit (at least on slower/embedded devices). Unfortunately, JRedis is the only maintained Java Redis Client API currently =)

@antis0c
Copy link
Author

antis0c commented Sep 1, 2010

Here's a link to a screenshot of the Android trace:

http://i.imgur.com/4esy9.png

@alphazero
Copy link
Owner

Great. I just got a android phone and was planning on running JRedis on it.

And yes, of course, grabbing that chunk of memory on classload is prohibitive for a mobile device.

But the RI is not intended for mobile devices. Its a server connector and is optimized for speed at cost of space and startup cost. Convert does in fact speed things up.

If you want to build out a RIM (RI Mobile) implementation for JRedis APIlet me know what you need in terms of support. Its quite modular so you should have good reuse if you base RIM on RI.

/R

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants