OOOooohhh.. Ahhh..

In a scenario where you were optimizing for performance regardless of cost,
you could do something similar to this and get from Memcache and from
datastore at the same time and check every 2ms to see which answers you
have.   That could save me 10ms average. Muahhahahahahaa.

 

Thanks for the idea. If I get to implementing it I will post the code back
here.

 

 

From: google-appengine@googlegroups.com
[mailto:google-appengine@googlegroups.com] On Behalf Of Johan Euphrosine
Sent: Friday, August 10, 2012 6:55 AM
To: google-appengine@googlegroups.com
Subject: Re: [google-appengine] Can you tweak the memacache timeout

 

I answered your question on S/O:

http://stackoverflow.com/a/11902993/656408

 

tltr; It's less straightforward in Java than it is in Python, you should
feel a feature request on the public issue tracker to improve the API.

http://code.google.com/p/googleappengine/issues/entry?template=Feature%20req
uest

 

Hope that helps.

 

On Fri, Aug 10, 2012 at 5:18 AM, Emanuele Ziglioli
<theb...@emanueleziglioli.it> wrote:

I'm doing some experiments on
com.google.appengine.api.memcache.MemcacheServiceImpl

 

  private static <T> T quietGet(Future<T> future) {

    try {

//      return future.get();

      return future.get( 100, TimeUnit.MILLISECONDS);

    } catch (TimeoutException ex) {

//      throw new ExecutionException(createDeadlineException());

      logger.log(Level.WARNING, ex.getMessage() + " " + future );

      return null;

    }

    catch (InterruptedException e) {

      Thread.currentThread().interrupt();

      throw new MemcacheServiceException("Unexpected failure", e);

    } catch (ExecutionException e) {

      Throwable cause = e.getCause();

      if (cause instanceof RuntimeException) {

        throw (RuntimeException) cause;

      } else if (cause instanceof Error) {

        throw (Error) cause;

      } else {

        throw new UndeclaredThrowableException(cause);

      }

    }

  }

 



I'm not sure if it's working 100% yet, the web app seems to open faster, but
there are still errors.

I'm sure something can be improved around there....

I'm off next week, have fun

 

 

 

 

-- 
You received this message because you are subscribed to the Google Groups
"Google App Engine" group.

To view this discussion on the web visit
https://groups.google.com/d/msg/google-appengine/-/aKrs3-BElJwJ.


To post to this group, send email to google-appengine@googlegroups.com.
To unsubscribe from this group, send email to
google-appengine+unsubscr...@googlegroups.com
<mailto:google-appengine%2bunsubscr...@googlegroups.com> .
For more options, visit this group at
http://groups.google.com/group/google-appengine?hl=en.





 

-- 
Johan Euphrosine (proppy)
Developer Programs Engineer
Google Developer Relations

-- 
You received this message because you are subscribed to the Google Groups
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com.
To unsubscribe from this group, send email to
google-appengine+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/google-appengine?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.

Reply via email to