Global namespace pollution is not inherently bad, similar to a lot of coding paradigms it’s more meant for the longevity and maintainability of an application. You can still use bootstrap in this case too, you’ll just be importing it differently (similar to how the link mentioned bringing in jQuery with a cdn). You can then take out turbo, stimulus, and sass to really bring down the complexity and not even need to us esbuild or a sass compiler. If you are just using this for a project and don’t need the complexity of a JS bundler, you can bring back UJS which is how things were done by default before. Last time I looked at the rails guides for app javascript best practices it was fairly lacking, mostly because it’s not entirely it’s responsibility to go in-depth about JS development. Rails is a very mature framework that’s been around for a long time, which is both great from a stability and feature rich perspective, but also potentially frustrating from a learning perspective because there may be a lot of outdated information. I apologise if my thoughts are scattered all over the place but that’s basically how I’m feeling right now lol. I know you said “no more global accessibility etc.”, but what are the consequences of importing the jquery (or any other javascript/css library) in the application layout as above? I realise that every view using these would have to be rendered inside application layout (which happens by default, but can be changed) but are there any other consequences? I’m guessing not being able to override styles (for css) easily might be one. When I started a new project with rails new project_name -c bootstrap does that use esbuild by default? In general, how can I tell? (This isn’t a complaint… just the situation I’m finding myself in.) The problem with finding beginner friendly Rails resources seems to be a lot of refer back to older ways of doing things (generally speaking, but also the asset pipeline in particular) and a lot of them lead me down rabbit holes that I often can’t tell are worth burrowing into or not. However, I suspect that this may well be quite brittle and create hard to debug situations.Actually I’m new to the whole web development thing altogether… working on a student project (with a looming deadline). It might be possible to make use of this or some derivative of this to JIT compile an entire module with a set of flags that sometimes change. If you really want the behavior suggested, Numba has jit_module (docs: Automatic module jitting with jit_module - Numba 0.55.1+0.g76720bf88.dirty-p圓.7-linux-x86_64.egg documentation). Docs: Frequently Asked Questions - Numba 0.55.1+0.g76720bf88.dirty-p圓.7-linux-x86_64.egg documentation The recompile() method exists to handle cases such as a global variable that a function refers to changing (recall that Numba considers global variables as compile time constants, so if they change, need to recompile). The Numba dispatcher object (the thing returned by is configured directly from the decorator options, theĬonfiguration is not intended to be changed once the dispatcher object is constructed. Some_calc_true.parallel_diagnostics(level=2) # prange threads will potentially launch more threads # foo_true has a parallel prange calling a parallel some_calc # foo_false has a parallel prange calling a serial some_calc # Array operations will be parallelized if parallel=True An example of triggering this might be: from numba import njit, prange, get_num_threads Whilst harder to demonstrate, similar issues potentially exist with parallel=True, particularly with regards to ending up with inadvertently nested parallel regions which could end up with poor performance. An example of something unsafe happening might be a library with a function that is sensitive to order of operations or NaN handling, it would be potentially be invalid to recompile this with fastmath=True as it would break to original intent of the library.Ĭoncrete example of this: from numba import njit I don’t think that this can be considered safe in general, though it might be possible to write in very careful and restricted way to permit this in some circumstances. Hi consider the question a bit more broadly than my particular use-case: Would it be a good idea to be able to change arguments when recompiling a jitted function?įirst, some general remarks RE changing compilation flags.
0 Comments
Leave a Reply. |