Skip to content

Instantly share code, notes, and snippets.

View black7375's full-sized avatar
💭
I may be slow to respond.

MS_Y black7375

💭
I may be slow to respond.
View GitHub Profile
@ArtemGr
ArtemGr / pcre-jit.rs
Last active April 6, 2021 21:03
Example using JIT-compiled PCRE expressions from Rust.
pub struct PcreJit {
pub re: Mutex<pcre::Pcre>,
/// Map from a capturing group name to its number.
/// `None` if no named capturing groups found or if the `auto_capture` option is given to `PcreJit::new`.
pub names: Option<BTreeMap<String, Vec<usize>>>}
unsafe impl Sync for PcreJit {}
unsafe impl Send for PcreJit {}
impl PcreJit {
/// JIT-compiles the regular expression.
///
@paulirish
paulirish / what-forces-layout.md
Last active April 28, 2025 06:24
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent

Contributing

When contributing to this repository, please first discuss the change you wish to make via issue, email, or any other method with the owners of this repository before making a change.

Please note we have a code of conduct, please follow it in all your interactions with the project.

Pull Request Process

  1. Ensure any install or build dependencies are removed before the end of the layer when doing a