search for: memoized

Displaying 20 results from an estimated 109 matches for "memoized".

Did you mean: memorized
2012 Apr 26
2
Memoize and vectorize a custom function
...<- sapply(rep(seqs,100), GCm1)) user system elapsed 0.164 0.000 0.173 > > library(R.cache) > GCm2 <- addMemoization(GC) > system.time(dummy <- sapply(rep(seqs,100), GCm2)) user system elapsed 10.601 0.252 10.926 Notice that the memoized functions are several orders of magnitude slower. I tried the `hash` package, but things seem to be happening behind the scenes and I don't understand the output: > cache <- hash() > GCc <- function(s) { if (!is.character(s) || nchar(s) == 0) { return(N...
2012 Feb 03
1
rails memoize and reload class => error raised
Hi, That''s a bit off topic but since I use Spork + Rspec... Well, my classes are reloaded between each test wave so Rails'' "memoize" method raises an error (which is expected, see code: http://rubydoc.info/docs/rails/3.0.0/ActiveSupport/Memoizable:memoize) Anyone resolved this issue with an elegant solution?
2016 May 12
0
[PATCH 4/4] lib: qemu: Memoize qemu feature detection.
...ies that qemu is linked to (×2 because we need to run qemu twice). Fixing that is seriously hard work. Therefore memoize the results of guestfs_int_test_qemu. This is keyed on the size and mtime of the qemu binary, so if the user changes the qemu binary (eg. setting LIBGUESTFS_HV) we discard the memoized result and rerun the qemu commands. There is also a generation number so we can bump the generation in future versions of libguestfs to invalidate all previously cached data. The memo is stored in the supermin cache directory (eg. /var/tmp/.guestfs-*) in the files: qemu.stat Result of '...
2010 Sep 23
1
[patch] Properly memoize protected methods
This patch fixes an issue with protected methods becoming public if they are memoized. Looking for +1''s and/or a commit by core... https://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/5695 Thanks. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyon...
2012 Feb 09
0
memoize and invalidation - backwards?
Maybe this is because I''m missing something but it seems to me that asking users of a memoized method to know when the method needs to be reloaded is a bit backwards. To me it seems like whoever is messing with something that affects the results of the memoized function should be the one that after doing its work should call something like memoized_method(:reset). Thoughts? -- You received...
2010 Aug 25
2
Why freeze memoization?
I was wondering what was the reasoning behind freezing the Memoizable return values? Thanks -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to
2009 Jan 20
5
Problem running rake test
...pack-2.2.2/lib/ action_view/template_handlers/erb.rb:51:in `compile'' from C:/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/ action_view/template_handler.rb:11:in `call'' from C:/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/ action_view/renderable.rb:21:in `_unmemoized_compiled_source'' from C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/ active_support/memoizable.rb:57:in `compiled_source'' from C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/ active_support/memoizable.rb:25:in `__send__'' ... 24 le...
2011 Nov 03
1
Call function only when running via R CMD check?
...memoization to cache computational expensive results (via the 'R.cache' package). These are cached to files which are by default stored under ~/.Rcache/. It turns out that these files live beyond the check cycle of the CRAN check servers, meaning that the next time the package is checked memoized results will be picked up. If I could detect that we're running via 'R CMD check', then I could change the default cache directory to a temporary directory (e.g. tempdir()) that will be clean out automatically. This is not a critical problem, because for now I could explicitly turn of...
2018 Oct 04
2
Re: [PATCH v2] lib: Use qemu-img info -U option to avoid locking error.
On Wed, Sep 26, 2018 at 06:36:47PM +0200, Pino Toscano wrote: > On Friday, 21 September 2018 11:53:52 CEST Richard W.M. Jones wrote: > > +/** > > + * Test if the qemu-img info command supports the C<-U> option to > > + * disable locking. The result is memoized in the handle. > > + * > > + * Note this option was added in qemu 2.11. We can remove this test > > + * when we can assume everyone is using qemu >= 2.11. > > + */ > > +static int > > +qemu_img_supports_U_option (guestfs_h *g) > > +{ > > + if (g-...
2013 Nov 03
3
[LLVMdev] freeing alloca'd variables before function exits
Hi, In my llvm code I want to create some function calls. The function prototype is as follows: int memoize ( char *function_name, int *int_params, unsigned num_ints, double *double_params, unsigned num_doubles) In order to create these calls I do the following for example: %88 = alloca [7 x i8] store volatile [7 x i8] c"ORACLE\00", [7 x i8]*
2012 Sep 15
2
Risk of readRDS() not detecting race conditions with parallel saveRDS()?
I hardly know anything about the format used in (non-compressed) serialization/RDS, but hoping someone with more knowledge could give me some feedback; Consider two R processes running in parallel on the same unknown file system. Both of them write and read to the same RDS file foo.rds (without compression) at random times using saveRDS(object, file="foo.rds", compress=FALSE) and
2015 Mar 12
1
[PATCH] generator: small optimization of pod2text cache memoization
Instead of save every time there's a new element in the cache, batch the saving to disk every 100 changes, saving the unsaved remainder at the exit. While not a big optimization, this reduces a bit the disk usage during generator run. --- generator/utils.ml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/generator/utils.ml b/generator/utils.ml index
2018 Sep 21
4
[PATCH v2] lib: Use qemu-img info -U option to avoid locking error.
...;); if (filename[0] == '/') @@ -218,3 +224,36 @@ set_child_rlimits (struct command *cmd) guestfs_int_cmd_set_child_rlimit (cmd, RLIMIT_CPU, 10 /* seconds */); #endif } + +/** + * Test if the qemu-img info command supports the C<-U> option to + * disable locking. The result is memoized in the handle. + * + * Note this option was added in qemu 2.11. We can remove this test + * when we can assume everyone is using qemu >= 2.11. + */ +static int +qemu_img_supports_U_option (guestfs_h *g) +{ + if (g->qemu_img_supports_U_option >= 0) + return g->qemu_img_supports_U_op...
2010 Aug 11
2
[LLVMdev] LSR is Unbearably Slow
I just filed bug 7872 about non-scalability of the LSR analysis algorithms. It may be related to bug 6727. The fundamental problem appears to be re-running SCEV analyses such as properlyDominates and SCEVComplexityCompare over and over again on large SCEV expressions. Memoizing results for SCEVComplexityCompare appears to help significantly but that is much harder to do with things like
2018 Oct 04
1
Re: [PATCH v2] lib: Use qemu-img info -U option to avoid locking error.
...at 06:36:47PM +0200, Pino Toscano wrote: > > > On Friday, 21 September 2018 11:53:52 CEST Richard W.M. Jones wrote: > > > > +/** > > > > + * Test if the qemu-img info command supports the C<-U> option to > > > > + * disable locking. The result is memoized in the handle. > > > > + * > > > > + * Note this option was added in qemu 2.11. We can remove this test > > > > + * when we can assume everyone is using qemu >= 2.11. > > > > + */ > > > > +static int > > > > +qemu_img_suppo...
2003 Aug 02
7
[2.6] Perl weirdness with ext3 and HTREE
Hi I have mailed about this previously, but back then it was not really confirmed, so I have let it be at that. Anyhow, problem is that for some reason 2.5/2.6 ext3 with HTREE support do not like what perl-5.8.0 does during installation. It *seems* like one of the temporary files created during manpage installation do not get unlinked properly, or gets into the hash (this possible?) and cause
2013 Nov 04
0
[LLVMdev] freeing alloca'd variables before function exits
Stack colouring should be able to reuse the same stack space, if the live ranges of the pointers don't overlap. But I don't think anyone has built a general solution for alloca'd space. On Mon, Nov 4, 2013 at 6:30 AM, Ali Javadi <aj14889 at yahoo.com> wrote: > Hi, > > In my llvm code I want to create some function calls. The function > prototype is as follows: >
2018 Sep 26
0
Re: [PATCH v2] lib: Use qemu-img info -U option to avoid locking error.
On Friday, 21 September 2018 11:53:52 CEST Richard W.M. Jones wrote: > +/** > + * Test if the qemu-img info command supports the C<-U> option to > + * disable locking. The result is memoized in the handle. > + * > + * Note this option was added in qemu 2.11. We can remove this test > + * when we can assume everyone is using qemu >= 2.11. > + */ > +static int > +qemu_img_supports_U_option (guestfs_h *g) > +{ > + if (g->qemu_img_supports_U_option >= 0)...
2017 Sep 15
2
IVUsers pass is fragile. Is this okay? How can it be resolved?
...i32 (ret true) SCEV: {(trunc i64 %v1 to i32),+,1}<%loop> * User: %1 = sub i32 %iv2, %0 SCEV: {((-1 * (trunc i64 %v1 to i32)) + %v2),+,(-1 + (-1 * (trunc i64 (-1 * %v1) to i32)) + (-1 * (trunc i64 %v1 to i32)))}<%loop> * User: %5 = sub i32 %1, %4 (memoized - ret true) * User: %2 = sitofp i32 %1 to double (ret false) **** ADD as user of %1 def **** %iv2 = phi i32 [ %v2, %entry ], [ %5, %loop ] SCEV: {%v2,+,((-1 * (trunc i64 (-1 * %v1) to i32)) + (-1 * (trunc i64 %v1 to i32)))}<%loop> * User: %1 = sub i32 %iv2, %0 (memoized - ret true...
2018 Oct 04
0
Re: [PATCH v2] lib: Use qemu-img info -U option to avoid locking error.
...On Wed, Sep 26, 2018 at 06:36:47PM +0200, Pino Toscano wrote: > > On Friday, 21 September 2018 11:53:52 CEST Richard W.M. Jones wrote: > > > +/** > > > + * Test if the qemu-img info command supports the C<-U> option to > > > + * disable locking. The result is memoized in the handle. > > > + * > > > + * Note this option was added in qemu 2.11. We can remove this test > > > + * when we can assume everyone is using qemu >= 2.11. > > > + */ > > > +static int > > > +qemu_img_supports_U_option (guestfs_h *g) &g...